PHP - Weird Behaviour.
I have a development machine running WAMP on a win7 64 bit box. php 5.3.13
I have a server that runs Apache 2.2, php 5.3.12 MySql, etc.
I am running joomla 2.5.27 on both machines.
I require a number of php includes to many of the joomla articles (this works great via a plugin called Directphp)
After considerable time getting the site fully working on the dev machine, I ran into an unforseen problem when I uploaded to the production box.
For some unknown reason, the includes work fine on the dev machine using $DOCUMENT_ROOT to define the root (then tag the correct path and file to this)
However, on the production box, this doesn't work - but... $_SERVER['DOCUMENT_ROOT'] does.
Annoyingly, $_SERVER['DOCUMENT_ROOT'] won't work on the dev machine - and $DOCUMENT_ROOT doesn't work on the production box.
So, I can't come up with a generic method to keep both machines happy.
I've checked the php.ini files on both boxes and the register global is OFF on both.
They also seem to interperate the syntax differently in the actual include files - one box hates double quotes - the other has issues with single quotes.
This is really annoying as most of the includes are HTML snippets, coded into php.
The double/single quote problem means I would need to have two versions of the include files.
Can anyone help me with this? - serious hair pulling has started!
Similar TutorialsHi Guys, I am fairly new to PHP, and I recently changed my whole site to use PHP sessions, which worked fine. Then I added PHP parts in my pages that display different menu choices depending on if a PHP session exists. This also works fine, until I found that any HTML/PHP pages that have form/submits no longer work, and I get kicked back to the index.php After slow backtracking, I removed new parts, and found the forms started working again if I removed the PHP part that chooses which JavaScript file to reference, as follows from contact.php <?php if (isset($_SESSION['SESS_MEMBER_ID'])){ echo "<script language=\"JavaScript\" type=\"text/javascript\" src=\"menu_horz.js\"></script>"; } else {echo "<script language=\"JavaScript\" type=\"text/javascript\" src=\"log_menu_horz.js\"></script>"; } ?> I tried changing the echo ".." to use single quotes ' ' instead, but then it doesn't work at all then with a form or no form on the page. I assume I am doing something wrong, but I can't find any resources that give me a definitive way of referencing Javascript files. What freaked me out was only the ones with forms were an issue. I am using <?php session_start(); ?> at the beginning of every page (before any output). Other PHP code on the page is working fine. Only the above part seems to be the problem, and works too, as long as I don't submit a form. - Could it be more weirder :-) - I tried also to find a workaround, but it would mean having PHP inside my JavaScript file, but I am not sure it would work, since JS is client side, and PHP server... Essentially, I just want to run certain JS menus depending if the person is logged in or not. - Example contact.php attached Any ideas of what the problem might be with the code above? Will be grateful for any help you can give. Regards D I think I put this in the wrong forum, as it seems to be more of a php problem (I think) I'm trying to populate a profile page with information from the database. Really bizarrely, every $row variable that isn't null returns as 'website', which is the database username. I have absolutely no idea why this is. It might be worth noting I have just changed hosts...the only thing I can think might make a difference. Any help would be great, thankyou $query = "SELECT * FROM member WHERE username='$member'"; $result = mysqli_query ($dbc, $query) or trigger_error ("query: $query\n<br />MySQL Error: " . mysqli_error($dbc)); if ($result) { while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { $member_id = $row['member_id']; $username = $row['username_id']; $photo = $row['photo']; $about = $row['about']; $slink = $row['soundcloud_link']; $mlink = $row['mixcloud_link']; $flink = $row['facebook_link']; $dlink = $row['divshare_link']; $mylink = $row['myspace_link']; $plink = $row['postbocks_links']; $website = $row['personal_website']; $type = $row['member_type']; $status = $row['status']; } } } I've echo'd the $query and put the result into sql directly and it comes out fine. I have something strange going on with sessions set after a user logs in. After posting the form, the following code (only part of the log in script) correctly assigns the users ID to $_SESSION['id'] but after a while it starts showing up as the users level ($_SESSION['level']). I have rechecked all of my code to see if something mistakenly assigns the level to $_SESSION['id'] but everything seems fine. I am going to rewrite the log in script today, as I am sure that I can streamline it but wondered if anyone can give any advice on what it happening here to make sure I do not fall into the same trap! Thanks Steve $username = mysql_escape_string($_POST['Lname']); $password = mysql_escape_string(md5($_POST['Lpassword'])); $search = mysql_query("SELECT userid, username, password, active, level FROM users WHERE username like binary '".$username."' AND password='".$password."' AND active='1'") or die(mysql_error()); $match = mysql_num_rows($search); $level = mysql_fetch_assoc($search); if($match > 0) //The username and password is correct {//START MANUAL LOGIN & SET SESSION VARIABLES $_SESSION['user'] = $username; $_SESSION['level'] = $level['level']; $_SESSION['loggedin'] = '1'; $_SESSION['id'] = $level['userid']; I have 2 pieces of different code that get run at different times, but act on the same text file. (The first example writes data and the second rewrites data with some expired data removed from the rewrite.) The first code example appends data to a new line each time it is run except when it is run just after the second code example has ran. When run after the second example, the first code example will append the data to the last line of the text file instead of appending to a new line. Why is this? Here is the first code example... Code: [Select] <?php $message = "Hello, World! \nGoodbye!"; $message_br = str_replace("\n", '<br />', $message); // couldn't use nl2br because i needed to remove the \n completely. $userName = "Anon"; $coordinates = "1234567890"; $locationType = "geo"; $dateDay = "23"; $dateMonth = "2"; $dateYear = "2011"; $timeHour = "9"; $timeMins = 45; $timeAMPM = "AM"; // Format the time/Date date_default_timezone_set('UTC'); $inputTime = date('c', mktime((int)$timeHour, (int)$timeMins, 0, (int)$dateMonth, (int)$dateDay, (int)$dateYear)); // Send all data so far, to an array. $entry_array = array(); array_push($entry_array, $inputTime, $locationType, $coordinates, $userName, $message_br); // write the array to CSV file. $fp = fopen('messages.txt', 'a'); fputcsv($fp, $entry_array, "|"); fclose($fp); ?> Here is the second... Code: [Select] <?php $one_day = 60*60*24; $timestamp = time(); date_default_timezone_set('UTC'); $expiry_date = date('c', $timestamp+$one_day); $future_date = array(); $delete_line = array(); // Open existing data in the text file. $lines = file('messages.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); foreach ($lines as $line){ list($field1, $field2, $field3, $field4, $field5) = explode('|', $line); if ($field1 < $expiry_date){ array_push($delete_line, $line); // add to the to-be-deleted array. } else { array_push($future_date, $line); } } $array2string = implode("\n", $future_date); // convert array data to string. // write the data to CSV file. $fp = fopen('messages.txt', 'w'); fwrite($fp, $array2string); fclose($fp); ?> Please help. I have tried to condense the following code to make it easier for someone to shed insight. The results make totally no sense to me.
I have the following two lines of code: require_once('/var/www/bidjunction/application/classes_3rd/htmlpurifier/library/HTMLPurifier.auto.php'); $config = HTMLPurifier_Conf::createDefault();Let me explain what happens in these two lines of code. First.... require_once('/var/www/bidjunction/application/classes_3rd/htmlpurifier/library/HTMLPurifier.auto.php'):HTMLPurifier.auto.php is shown below: <?php /** * This is a stub include that automatically configures the include path. */ set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path() ); require_once 'HTMLPurifier/Bootstrap.php'; require_once 'HTMLPurifier.autoload.php'; // vim: et sw=4 sts=4The only thing Bootstrap.php does is define a class and execute the following line: define('HTMLPURIFIER_PREFIX', realpath(dirname(__FILE__) . '/..'));The only thing HTMLPurifier.autoload.php does is execute HTMLPurifier_Bootstrap::registerAutoload() (which was one of the classes defined in Bootstrap.php). The only thing HTMLPurifier_Bootstrap::registerAutoload() does is: spl_autoload_register(array('HTMLPurifier_Bootstrap','autoload'), true, true);Now the second line: $config = HTMLPurifier_Conf::createDefault();I expected that HTMLPurifier_Conf::createDefault() would be executed, but no, instead the script goes to HTMLPurifier_Bootstrap:autoload() which returns false. Next, the script goes to function PHPMailerAutoload() which is in PHPMailerAutoload.php. What!!! What does PHPMailerAutoload have to do with this? While a perfect answer would be great, general comments and a strategy to troubleshoot be the next best thing. I am stumped! Please help. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=306496.0 Dear all, I updated my versions of php/MySQL and OS to Windows 7 Professional and weird "Warnings and Notices:" started popping up. E.g. Code: [Select] "Notice: Undefined index: page in C:\Server\htdocs\domain\index.php on line 25 " Code: [Select] Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for '-4.0/DST' instead in C:\Server\htdocs\domain\index.php on line 12 " I don't know what is going on. Unless I enter these following functions (error_reporting(0);, session_start() with their parameters these warnings display. Can anyone offer any advice? Any assistance is appreciated. this works Code: [Select] <form action="" method="post"> <input name="DepartureDate" type="text"> <input name="" type="submit"></form> <?php $DepartureDate=$_POST['DepartureDate']; echo $DepartureDate = stripslashes($DepartureDate); // sql inject clean $regex = "/^[a-z]+$/"; if (!preg_match($regex, $DepartureDate)){ echo 'CAPS BABY!';} else {echo 'OK!';} ?> this doesnt Code: [Select] if (!preg_match($regex, $DepartureDate)) { mail($to, $subject, $message, $headers); echo $url_success = "confirmation.php"; //echo("<meta http-equiv = refresh content=0;url=".$url_success.">"); } else { exit(); } Okay, so basically my news-like site is supposed to print out article data saved in the database. It does that quite alright, except on the 3rd article (number 2 in SQL rows or columns. whichever it is. I have my counter subtract 1 from the start article to compensate for MySQL) My code: Code: [Select] <?php print "<div class = 'menu' align='center'>Newest Stories</div>"; if (isset($_REQUEST['mstart'])) { $start=$_REQUEST['mstart']; } else { $start=1; } if ($start) { $start=1; } $start--; $end=$start+5; $stories = mysql_query("SELECT * FROM stories ORDER BY id DESC LIMIT $start, $end") or die(mysql_error()); $num = mysql_num_rows($stories); $start++; if ($num > 0) { if ($num<$end) { $end = $end-(5-$num); } print "<b><i>Showing stories $start to $end</i></b>"; for ($count=0; $count<$num; $count++) { print "<hr>"; $story = mysql_fetch_array($stories,$count); $id = $story['id']; $headline = $story['headline']; $author = $story['author']; $desc = $story['description']; $content = $story['content']; print "COUNT: $count OF $num ($id)<br>"; print "<a href='index.php?request=story&mstart=$start&story=$id' class='headlinelink'>$headline</a><br>"; print "<div class='author'>Posted by: <a href='index.php?request=author&mstart=$start&author=$author' class='author'>$author</a>.</div>"; print "<div class='desc'>$desc</div><br>"; } } else { print "Error. No stories found. :("; } ?> Output: (The COUNT x OF y was to help me figure out what is wrong. In the () by it is the id number of the corresponding MySQL row/column. I even deleted one of the articles to see if it was a specific article error. No luck.) Quote Newest Stories Showing stories 1 to 5 ---------------- COUNT: 0 OF 5 (6) Y U NO STAY Posted by: craigory83. GRRR ---------------- COUNT: 1 OF 5 (5) h-l! Posted by: craigory83. desc ---------------- Notice: Undefined index: id in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\dba\menu.php on line 37 Notice: Undefined index: headline in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\dba\menu.php on line 38 Notice: Undefined index: author in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\dba\menu.php on line 39 Notice: Undefined index: description in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\dba\menu.php on line 40 Notice: Undefined index: content in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\dba\menu.php on line 41 COUNT: 2 OF 5 () Posted by: . ---------------- COUNT: 3 OF 5 (2) This is the second story! Posted by: TDWP83. See, I fuckin told you so! Warning: mysql_fetch_array() [function.mysql-fetch-array]: The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\dba\menu.php on line 36 ---------------- COUNT: 4 OF 5 (1) This is the mother fucking headline! Posted by: craigory83. stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff Hey guys, how are you. I have an odd problem and I am not sure what is causing it. I recently finished my form system, with PHP validation that sends the inputted information via email. Now, everything is working fine on my end with absolutely no issues, but it is not working on any other computers, even though my computer is in no way hosting the files. Now, the issue other computers are getting is when the form is filled out it doesn't redirect to the success page, it redirects back to the form page with nothing filled out and it doesn't display the errors on the page. Any idea on what might be causing this? Again, EVERYTHING works flawlessly on my end, that being, the display of any errors, the proper redirect, everything. Thanks!!! tore the forum apart looking for a solution to this one. for some reason, this is generating an 'unexpected $end' error. this is ALL the code. in entirety. i was just messing around getting familiar with filesystem stuff. no short tags. no curly brackets. so... Code: [Select] <?php $fileHandler = fopen("someFile.txt", 'w') or die ("could not create file"); $text = <<<_END drop some text and some stuff plus this stuff some other stuff _END; fwrite($fileHandler, $text) or die ("could not write to file"); fclose($fileHandler); echo "File 'someFile.txt' written successfully"; ?> thanks people. this has be stumped. not like its complicated, eh? and as you can see, screws up the colour coding as well... but WHY!?!? WR! How can you prevent your browser from caching a page? I think that my news feed is being cached and is causing new posts to not be displayed even after a refresh. Eventually, the posts will show up after about 20 refreshes. I know my query is right so I didn't know if there was a way to stop page caching. I don't really know if it is a caching issue though. I'm starting to think I just have some weird bug in my code because sometimes on refresh news feed items get removed then i'll refresh again and some will get added back in then i'll refresh again and they'll all be there. Ever heard of this happening? Hello there, I am making a function to execute every time with a new demand no. in the while loop below. Every thing goes fine for the first time when the page loads, all the taxes come perfectly and each record is being read with the function calculateTaxes($demandno). But, when I press the search button with blank entries... All the entries come with only the first record. Means, the calculateTaxes function is not being loaded again and again with the loop when the press the search button. Please help. Please have a look in the below given code: Code: [Select] <?php function renderform($wardno, $demandno, $name) { include_once $_SERVER['DOCUMENT_ROOT'].'/npms/header.php'; include_once $_SERVER['DOCUMENT_ROOT'].'/npms/config/config.php'; include_once $_SERVER['DOCUMENT_ROOT'].'/npms/functions/functions.php'; include_once $_SERVER['DOCUMENT_ROOT'].'/npms/functions/connect-db.php'; extract($GLOBALS); if ($demandno == '' && $wardno == '' && $name == '') // all empty. { $result = mysql_query("SELECT * FROM sform where paid=false order by wardno, id, demandno limit 0,$maxrecords") or die(mysql_error()); } if ($demandno != '' && $wardno != '' && $name != '') // all full. { $result = mysql_query("SELECT * FROM sform where demandno='$demandno' and wardno='$wardno' and (name like '%$name%') and paid=false order by wardno, id, demandno") or die(mysql_error()); } if ($demandno != '' && $wardno == '' && $name == '') // demand full else empty. { $result = mysql_query("SELECT * FROM sform where demandno='$demandno' and paid=false order by wardno, id, demandno") or die(mysql_error()); } if ($demandno != '' && $wardno != '' && $name == '') // demand and ward full else empty. { $result = mysql_query("SELECT * FROM sform where demandno='$demandno' and wardno='$wardno' and paid=false order by wardno, id, demandno") or die(mysql_error()); } if ($demandno == '' && $wardno != '' && $name == '') // ward full else empty. { $result = mysql_query("SELECT * FROM sform where wardno='$wardno' and paid=false order by wardno, id, demandno") or die(mysql_error()); } if ($demandno == '' && $wardno != '' && $name != '') // ward and name full else empty. { $result = mysql_query("SELECT * FROM sform where wardno='$wardno' and (name like '%$name%') and paid=false order by wardno, id, demandno") or die(mysql_error()); } if ($demandno == '' && $wardno == '' && $name != '') // name full else empty. { $result = mysql_query("SELECT * FROM sform where (name like '%$name%') and paid=false order by wardno, id, demandno") or die(mysql_error()); } if ($demandno != '' && $wardno == '' && $name != '') // demand and name full else empty. { $result = mysql_query("SELECT * FROM sform where demandno='$demandno' and (name like '%$name%') and paid=false order by wardno, id, demandno") or die(mysql_error()); } usleep(200000); // wait for 2 seconds ?> <link rel=stylesheet HREF="/npms/css/sp.css" type="text/css" media="screen"> <div id="content"> <div id="labelopt"></div> <h2>okMZokj ukxfjdksa dh lwph</h2> <div id="list"> <form name="spsearchform" action="" method="post"> <table border="1" cellpadding="2px"> <tr> <td id="labelmust" width="10%">fM- dz- %</td> <td><input class="english" type="text" size="15%" name="demandno" maxlength="40" value="<?php echo $demandno; ?>" /></td> <td id="labelmust" width="10%">okMZ dz- %</td> <td><input class="english" size="20%" type="text" size="15%" name="wardno" maxlength="3" value="<?php echo $wardno; ?>"/></td> <td id="labelmust" width="10%">uke %</td> <td><input class="hindi" size="30%" type="text" name="name" maxlength="100" value="<?php echo $name; ?>"/></td> <td><input type="submit" value="Search" name="btnsearch" /></td> </tr> </table> </form> <div style="color: red;"><small><cite>List is limited to <? echo $maxrecords; ?> records. For precise searching, use the search options above.</small></cite></div> <table border="1" cellpadding="2px"> <tr> <td colspan="8" id="english"><div style="float: right; color: red; text-align: right; margin-right: 10px;"><small><cite><strong><? echo mysql_num_rows($result); ?> records</strong> dumped.</cite></small></div></td> </tr> <tr> <td id="labelcenter">okMZ dz-</td> <td id="labelcenter">fMeka.M dzekad</td> <td id="labelcenter">uke</td> <td id="labelcenter">irk</td> <td id="labelcenter">'kq} dj</td> <td id="labelcenter">dj fooj.k</td> <td id="labelcenter">fu;kstu</td> <td id="labelcenter">feVk;sa</td> </tr> <?php if (mysql_num_rows($result) > 0) { while($row = mysql_fetch_array( $result )) { echo "<tr>"; echo "<td id='english'><center>" . $row['wardno'] . "</center></td>"; echo "<td id='english'><center>" . $row['demandno'] . "</center></td>"; echo "<td id='hindi'>" . $row['name'] . "</td>"; echo "<td id='hindi'>" . $row['address'] . "</td>"; $taxes = calculateTaxes($row['demandno']); echo "<td id='english' align='right'>" . number_format($taxes['grosstax'],2) . "</td>"; echo '<td><center><a href="payments/taxreport.php?demandno=' . $row['demandno'] . '"><img src="../images/payment.jpeg" width="15" height="15" /></center></a></td>'; echo '<td><center><a href="spedit.php?demandno=' . $row['demandno'] . '"><img src="../images/edit.gif" width="15" height="15" /></center></a></td>'; echo '<td><center><a href="spdelete.php?demandno=' . $row['demandno'] . '"><img src="../images/delete.jpeg" width="15" height="15" /></center></a></td>'; } } else { echo "<tr>"; echo "<td colspan='7' align='center'><blink><strong>lwph miyC/k ugha gS A</strong></blink></td>"; echo "</tr>"; } ?> </tr> </table> </div> <div id="menu"> <table> <tr> <td> <input type="button" value="New" name="btnnew" onclick="location.href='spnew.php';" /> <input type="button" value="Back" name="btnspback" onclick="location.href='../sp.php';" /> </td> </tr> </table> </div> </div> <?php include_once $_SERVER['DOCUMENT_ROOT'].'/npms/footer.php'; } include_once $_SERVER['DOCUMENT_ROOT'].'/npms/functions/connect-db.php'; include_once $_SERVER['DOCUMENT_ROOT'].'/npms/functions/functions.php'; if(isset($_POST['btnsearch'])) { $wardno = mysql_real_escape_string(htmlspecialchars($_POST['wardno'])); $name = mysql_real_escape_string(htmlspecialchars($_POST['name'])); $demandno = mysql_real_escape_string(htmlspecialchars($_POST['demandno'])); renderform($demandno, $wardno, $name); } else { renderform('', '', ''); } ?> Howdy,
I am trying to create my website responsive. So far so good, but I got this weird white space on the right of my website and the user that is on a device smaller for 800px get a weird scroll bar. You can see it for yourself here, if you shrink the viewport to 800px or less - http://dyulgerova.in...ile_dyulgerova/
Here is my responsive CSS
/* For 800 pixels wide screens, MAX WIDTH. For example, tablets */ @media all and (max-width: 800px){ /* All images */ img {width:15vw;} /* The header */ #header{ background: #ff0000; width:100vw; } #section{ width:100vw; } #SkypeButton_Call_age_of_empires3_1_paraElement{ display:none; } #header_contact{ position: absolute; top: 120px; left: 394px; } #logo{ margin-top:20px; margin-left:0; } .langs{ margin-top:54px; margin-right:50px; } /* The nav bar */ #header #navigation{ width:100vw; height: 6.5vw; position:fixed; top:-15px; background: #000; height:10; } #header #navigation a{ border-left:1px solid #ff0000; } /* Below the header */ #main_div{ width:80vw; } footer{ width:80vw; } }And here is my NON-RESPONSIVE CSS * {margin: 0px; padding: 0px; } body { color: #E0E0E0; font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; background: #9C1C6B; background: -webkit-radial-gradient(center top, circle, rgba(0,0,0,.2), rgba(0,0,0,.4)) fixed no-repeat, -webkit-linear-gradient(#9C1C6B, #CA278C) fixed no-repeat; background: -moz-radial-gradient(center top, circle, rgba(0,0,0,1), rgba(0,0,0,1)) fixed no-repeat, -moz-linear-gradient(#9C1C6B, #CA278C) fixed no-repeat; background: -o-radial-gradient(center top, circle, rgba(0,0,0,1), rgba(0,0,0,1)) fixed no-repeat, -o-linear-gradient(#9C1C6B, #CA278C) fixed no-repeat; background: radial-gradient(center top, circle, rgba(0,0,0,1), rgba(0,0,0,1)) fixed no-repeat, linear-gradient(#9C1C6B, #CA278C) fixed no-repeat; background-size:contain, contain; } a, a:active, a:visited, a:hover{ color: #FFE9E8; } h3 { margin-bottom:20px; } #header a, #header a:active, #header a:visited, #header a:hover{ color: #000; text-decoration:none; } #header{ width:100%; height:100%; background-color:#FFF; border-bottom:#F00 3px ridge; margin-bottom:50px; background-color:#FFF; background: -webkit-linear-gradient(#F3F3F3, #f6f5f3); background: -moz-linear-gradient(#F3F3F3, #f6f5f3); background: -o-linear-gradient(#F3F3F3, #f6f5f3); background: linear-gradient(#F3F3F3, #f6f5f3); } #logo{ margin-left:200px; } #header #section{ color:#000; margin:auto; } #header #navigation{ width:1000px; height:40px; margin:auto; clear:both; } #header #navigation li a{ color:#999; border-bottom:rgba(0,0,0,0) 3px ridge; width:90px; line-height:40px; float:left; text-align:center; font-style:bold; font-weight:bold; transition:all .3s; -webkit-transition:all .3s; } #header #navigation li a:hover{ color:#222; border-bottom:#000 3px ridge; } /* Makes a navigation item bigger when applied the class */ .long_nav{ width: 176px; } footer a, footer a:active, footer a:visited, footer a:hover{ color: #FFF; text-decoration:none; } figure{ width:200px; height:133px; padding:10px; margin:10px; color:#000; text-align:left; font-size:12px; float:left; background: -webkit-radial-gradient(center top, circle, #FFFFFF, #DFDFDF); background: -moz-radial-gradient(center top, circle, #FFFFFF, #F3F3F3); background: -o-radial-gradient(center top, circle, #FFFFFF, #F3F3F3); background: radial-gradient(center top, circle, #FFFFFF, #DFDFDF); } ul { list-style-type: none; } ol { list-style-type: none; } li { margin-top: 10px; } hgroup{ color:#FFF; padding:5px; border-left: #E47297 3px solid; } p { line-height: 180%; } fieldset { border: 0px currentColor; } img { border:0; max-width: 100%; height: auto; / width: 100%; /* Resizes automatically on any devise. */ } input { margin: 10px; padding: 10px; border-radius: 20px; border: 0px currentColor; width: 300px; height: 30px; } textarea { padding: 10px; border-radius: 10px; border: 0px currentColor; margin-top: 5px; } #main_div { background-color:rgba(0,0,0,.01); margin:auto; width:1000px; padding:10px; clear:both; background: -webkit-linear-gradient(rgba(0,0,0,.0), rgba(0,0,0,.02)); background: -moz-linear-gradient(rgba(0,0,0,.0), #f6f5f3); background: -o-linear-gradient(rgba(0,0,0,.0), #f6f5f3); background: linear-gradient(rgba(0,0,0,.0), rgba(0,0,0,.02)); } footer{ color:#CA278C; padding:10px; border-top:#FFF 2px solid; margin-top:20px; width:725px; padding:20px 23%; overflow:hidden; background-color:#000; height:100%; } footer #navigation{ clear:both; } #bgDeco1{ background-color:#000; position:absolute; bottom:30px; right:10px; width:150px; height:150px; border-radius:50% 50%; opacity:.4; transition:all 1s; -webkit-transition:all 1s; } #bgDeco2{ background-color:#000; position:absolute; bottom:145px; right:25px; width:100px; height:100px; border-radius:50% 50%; opacity:.3; transition:all 1.5s; -webkit-transition:all 1.5s; } #bgDeco3{ background-color:#000; position:absolute; bottom:210px; right:75px; width:80px; height:80px; border-radius:50% 50%; opacity:.2; transition:all 2s; -webkit-transition:all 2s; } #bgDeco4{ background-color:#000; position:absolute; bottom:250px; right:75px; width:50px; height:50px; border-radius:50% 50%; opacity:.1; transition:all 2.5s; -webkit-transition:all 2.5s; } #bgDeco5{ background-color:#000; position:absolute; bottom:250px; right:75px; width:75px; height:75px; border-radius:50% 50%; opacity:.25; transition:all 2.5s; -webkit-transition:all 2.5s; } #bgDeco6{ background-color:#000; position:absolute; bottom:250px; right:75px; width:55px; height:55px; border-radius:50% 50%; opacity:.35; transition:all 2.5s; -webkit-transition:all 2.5s; } #SkypeButton_Call_age_of_empires3_1 { float: right; } #div_main { width: 590px; } #skills { font-size: 19px; margin-top: 40px; margin-bottom: 40px; } .portfolio { padding:14px; margin:14px 0; min-height:200px; border-left:#E47297 2px solid; clear:both; cursor:pointer; transition:all .3s; -webkit-transition:all .7s; } .portfolio:hover{ background-color:rgba(255,255,255,.05); } #menu input{ width: 149px; height: 16px; } #menu input[type="submit"]{ padding-bottom: 25px; } #menu form{ height:300px; border:1px solid red; } #menu { margin: 10px; padding: 10px; width: 200px; float: left; } #menu a { font-size: 18px; font-weight: bold; margin-top: 10px; margin-right: 10px; display: block; } #calendar_div { border: 1px solid black; width: 245px; float: left; overflow:hidden; } .buttons { padding-right: 10px; float: right; } #calendar { width: 210px; float: left; overflow:hidden; } #calendar tr > th { color: rgb(0, 0, 0); padding-right: 20px; } #article { padding: 10px; width: 490px; float: left; margin-bottom:40px; border-bottom:2px solid red; } #article p { text-indent: 20px; } #article h1 { border-left:#FFF 2px solid; color:#FFF; background-color:rgba(255,255,255,.15); padding:5px; padding-left:10px; margin:10px 0; } #article h4 { margin: 10px; color: pink; } #comment_form { margin: auto; width: 500px; overflow: hidden; } .comment { background: rgb(167, 211, 241); margin: 10px auto 30px; padding: 10px; border-radius: 10px; border: 1px solid red; width: 500px; height: auto; color: rgb(0, 0, 0); overflow: hidden; } h3.commentator { text-align: left; } #links { width: 400px; margin:auto; } #links li { padding-top: 10px; } .about { width: 1000px; overflow: hidden; } .about img { margin: 10px; overflow: hidden; float: left; } .about p { padding: 10px; } #contact_picture { width:500px; float:right; } #contact_info { float: right; } .red { margin: 10px; padding: 10px; width: 500px; height: auto; overflow: hidden; float: left; } #contact_form { padding: 10px; width: 477px; overflow: hidden; } .secret { display: none; } #uploading { padding: 10px; border: 1px solid red; width: 500px; } .wrong_answer { background: red; padding: 10px; border: 1px solid green; color: white; } .correct_answer { background: green; border: 1px solid orange; } label { display: block; } #secret{ display:none; } /********************************** Blog ***********************************/ #category{ float:right; margin:10px; } /* the class for the flags */ .langs{ float:right; margin:15px; box-shadow: 6px 6px 15px #545454; -webkit-box-shadow: 6px 6px 15px #545454; /* Support for Chrome, Safari, iOS, Android */ -moz-box-shadow: 6px 6px 15px #545454; /* Support for Mozilla -13 */ } /************************************* WP Plugins **************************************/ #single_plugin{ width:590px; margin:10px; border-bottom: 1px solid orange; }And here is my HTML structure for the index.php file <?php include 'html/header.php'; ?> <!-- This ID holds the entire inner container for this page --> <div id="main_div"> <h1>Hello World!</h1> <h3>My name is Stefany and I am from Bulgaria. I am a computer programmer and I create websites and web applications.</h3> <p id="skills"> <strong>Programming languages:</strong> PHP, Perl 5, JavaScript <br /> <strong>Front - end:</strong> HTML5, XHTML, CSS <br /> <strong>Databases:</strong> MySQL, SQLite, MariaDB, MSSQL <br /> <strong>Frameworks:</strong> CodeIgniter <br /> <strong>E-commerce Platforms:</strong> osCommerce, UniqueFree <br /> <strong>Other:</strong> XML, AJAX, JSON <br /> <strong>Web Services:</strong> REST, SOAP <br /> <strong>Content Management Systems:</strong> WordPress, Joomla <br /> I can create forums, blogs, social networks, E - stores, portfolios, WordPress themes, plugin and pretty much any type of website you can think of. <br /> Please take a look at my portfolio below and if you are interested to hire me, please don't hesitate to <a href="contact">contact me!</a> </p> <h2>Portfolio</h2> <div class="portfolio"> <h3><a href="http://tarsis-bg.com/" target="_blank"> Tarsis </a></h3> <a href="http://tarsis-bg.com/" target="_blank"><img src="images/project23.png" width="200" height="133" alt="Company website for selling flats" /></a> <p> Tarsis is a company that builds and sells flats in Sunny Beach, Bulgaria and I made their website on WordPress, including a custom made plugin that was used to build a separate CMS within WP for management of the flats that are for sale. <br /> Technologies used: XHTML, CSS, JavaScript, PHP, MySQL, WordPress </p> </div> <div class="portfolio"> <h3><a href="http://ungerne.dk/" target="_blank"> Ungerne </a></h3> <a href="http://ungerne.dk/" target="_blank"><img src="images/project22.png" width="200" height="133" alt="Web-shop for selling kids' clothes" /></a> <p> Danish web-shop for selling kids' clothes, built on osCommerce. I made major core modifications, such as fixes on the coupon, mail, search, shipping, product and shopping systems. <br /> Technologies used: XHTML, CSS, JavaScript, PHP, MySQL, osCommerce </p> </div> <div class="portfolio"> <h3><a href="http://www.br-electronic.dk/" target="_blank"> Bramming Electronic </a></h3> <a href="http://www.br-electronic.dk/" target="_blank"><img src="images/project21.png" width="200" height="133" alt="Web-shop for selling electronics" /></a> <p> UniqueFree built Danish web-shop for selling electronics. Made core modifications in the shipping system. <br /> Technologies used: XHTML, CSS, JavaScript, PHP, MySQL, UniqueFree </p> </div> <div class="portfolio"> <h3><a href="http://babyfryd.dk/" target="_blank"> BabyFryd </a></h3> <a href="http://babyfryd.dk//" target="_blank"><img src="images/project20.png" width="200" height="133" alt="BabyFryd web-shop for selling kids' clothes" /></a> <p> Another Danish web-shop for selling children's clothes build on UniqueFree <br /> Technologies used: XHTML, CSS, JavaScript, PHP, MySQL, UniqueFree </p> </div> <div class="portfolio"> <h3><a href="http://iskampak.com" target="_blank"> Iskam Pak </a></h3> <a href="http://iskampak.com/" target="_blank"><img src="images/project19.png" width="200" height="133" alt="A website about Angry Birds" /></a> <p> Dating website made entirely from scratch without any frameworks with a custom CMS build into it. <br /> It is currently a work in progress. <br /> Technologies used: XHTML, CSS, JavaScript, PHP, MySQL </p> </div> <div class="portfolio"> <h3><a href="http://angrybirds.me/" target="_blank">Angry Birds </a></h3> <a href="http://angrybirds.me/" target="_blank"><img src="images/project18.png" width="200" height="133" alt="A website about Angry Birds" /></a> <p> A website where you can play the legendary game Angry Birds for free. <br /> I made it with WordPress by tweaking a theme and installing plugins. <br /> Technologies used: XHTML, CSS, WordPress, PHP </p> </div> <div class="portfolio"> <h3><a href="http://dyulgerova.info/nc/index.php" target="_blank"> Wallace & Hull LLP</a></h3> <a href="http://dyulgerova.info/nc/index.php" target="_blank"><img src="images/project17.png" width="200" height="133" alt="Project 12" /></a> <p> The homepage of <strong>"Wallace and Hull LLP"</strong> lawyer firm from Oregon, Washington. It's part of a WordPress theme I made. <br /> Technologies used: HTML5, CSS3, WordPress </p> </div> <div class="portfolio"> <h3><a href="http://www.automirrorsexpress.com/" target="_blank"> Auto Mirrors Express</a></h3> <a href="http://www.automirrorsexpress.com/" target="_blank"><img src="images/project15.jpg" width="200" height="133" alt="Project 12" /></a> <p> E - shop for car mirrors. Created a tag cloud, fixed many DB issues and configured the server. <br /> Technologies used: XHTML, CSS, PHP, JavaScript, Perl, osCommerce </p> </div> <div class="portfolio"> <h3><a href="http://www.autolightcenter.com/index.php" target="_blank"> Auto Lights Center</a></h3> <a href="http://www.autolightcenter.com/index.php" target="_blank"><img src="images/project14.jpg" width="200" height="133" alt="Project 12" /></a> <p> E - shop for car lights. Made some grand changes with the design, the entire back end code and the DB. Greatly increased the security. <br /> Technologies used: XHTML, CSS, PHP, JavaScript, Perl, osCommerce </p> </div> <div class="portfolio"> <h3><a href="http://radiosean.co.uk/"> Radio Sean</a></h3> <a href="http://radiosean.co.uk/"><img src="images/project13.jpg" width="200" height="133" alt="Project 12" /></a> <p> Homepage of a British radio station. I created the search engine of the website. <br /> Technologies used: XHTML, PHP </p> </div> <div class="portfolio"> <h3><a href="/portfolio/otto" target="_blank"> Otto Steininger</a></h3> <a href="http://www.ottosteininger.com/" target="_blank"><img src="images/project12.jpg" width="200" height="133" alt="Project 12" /></a> <p> Coming soon page for the website of an animator/illustrator professional. <br /> Technologies used: XHTML, CSS, Javascript </p> </div> <div class="portfolio"> <h3><a href="http://freepic.eu/" target="_blank"> FreePic</a></h3> <a href="http://freepic.eu/" target="_blank"><img src="images/project11.png" width="200" height="133" alt="Project 11" /></a> <p> Free image hosting website. I created the GIF category, the admin panel and increased the security of the website. <br /> Technologies used: XHTML, CSS, PHP, MySQL, GD </p> </div> <div class="portfolio"> <h3><a href="http://studyingthepast.com/" target="_blank"> Studying The Past</a></h3> <a href="http://studyingthepast.com/" target="_blank"><img src="images/project10.png" width="200" height="133" alt="Project 10" /></a> <p> A website about history. 100% XHTML 1.0 and CSS valid. <br /> Technologies used: XHTML, CSS, PHP, SQLite </p> </div> <!-- The "portfolio" class is a div that holds one website at a time. That's why there are so many declarations of that div --> <div class="portfolio"> <!-- The name of the website in a header element with a link to it --> <h3><a href="http://sundaygolessons.com/" target="_blank">Sunday Go Lessons</a></h3> <!-- And a picture of the website again with a link to it because it's cool to also have a screenshot beside just a super boring link, WOW --> <a href="http://sundaygolessons.com/" target="_blank"><img src="images/project9.png" width="200" height="133" alt="Project 9" /></a> <!-- And a litte explanation as to what the website is the hell about. --> <p> A webshop for selling and renting <a href="https://www.usgo.org/what-go">Go</a> related books and videos, with integrated PayPal payment system. <br /> Technologies used: XHTML, CSS, PHP, MySQL, PayPal </p> </div> <!-- End of the previous website and now it's the turn of the next. The bragging continues... --> <div class="portfolio"> <h3><a href="http://code-forums.info/" target="_blank"> PHP Forum</a></h3> <a href="http://code-forums.info/" target="_blank"><img src="images/project7.png" width="200" height="133" alt="Project 7" /></a> <p> A programming forum coded from scratch, without using any PHP frameworks or ready made stuff. <a href="http://github.com/Stefany93/PHP-Forum">Source code.</a> <br /> Technologies used: XHTML, CSS, PHP, MySQL, JavaScript </p> </div> <div class="portfolio"> <h3><a href="http://dyulgerova.info/project_blog/" target="_blank">Bulgarian newspapper</a></h3> <a href="http://dyulgerova.info/project_blog/" target="_blank"><img src="images/project6.png" width="200" height="133" alt="Project 2" /></a> <p> This project has been made half way and it is currently frozen. <br /> Technologies used: XHTML, CSS, PHP, MySQL, JavaScript </p> </div> <div class="portfolio"> <h3><a href="http://www.bettercitiesforum.com/" target="_blank"> WordPress website about improving neighbourhoods</a></h3> <a href="http://www.bettercitiesforum.com/" target="_blank"><img src="images/project5.png" width="200" height="133" alt="Project 2" /></a> <p> I installed a Simple Machines Forum and made some tweaks on the source code as well on the site. <br /> Technologies used: WordPress, PHP </p> </div> <div class="portfolio"> <h3><a href="big_images/project4.png" target="_blank">Social Network</a></h3> <a href="big_images/project4.png" target="_blank"><img src="images/project4.png" width="200" height="133" alt="Project 2" /></a> <p> Including a forum, an individual learning module and an event calendar. The social network is private for the residents anesthesiologists of the Texas Tech University <br /> and therefore not in the public domain. I created it in twenty days from scratch. <br /> Technologies used: HTML5, CSS, PHP, MySQL, JavaScript. </p> </div> <div class="portfolio"> <h3><a href="http://chrisshilts.com/" target="_blank">Portfolio for a web designer.</a></h3> <a href="http://chrisshilts.com/" target="_blank"><img src="images/project3.jpg" width="200" height="133" alt="Project 2" /></a> <p> Basically I made the blog page with a custom Content Management System including an Admin panel. <br /> Technologies used: PHP, MySQL, JavaScript. </p> </div> <div class="portfolio"> <h3><a href="http://www.borsp.com/sandh/dazer/" target="_blank"> E - Shop</a></h3> <a href="http://www.borsp.com/sandh/dazer/" target="_blank"><img src="images/project2.jpg" width="200" height="133" alt="Project 2" /></a> <p> I made the front - end and my colleague made the back - end. It's in a process of being uploaded. <br /> Techologies used: XHTML, CSS, JavaScript. </p> </div> </div> <?php include 'html/footer.php'; ?>Please help me! I managed to fix the problem with "overflow-x:hidden" property of "body" in CSS, but I do believe this is way too wrong. Edited by Stefany93, 17 June 2014 - 11:06 AM. I absolutely cannot login with facebook. Won't work. I have an account I use for freelancing and I can't use it.
I tried signing up another account, verification won't work. It tells me I succeeded in putting the pieces together with a big green check mark, and then afterwards it tells me there was an error and I didn't enter in the code properly. No idea what to do. Been like this for a few days. What's going on?
I'm having a weird issue with any elements that are given a width: 100% or width: auto. If the window is re-sized smaller. It seems to cut a chunk off and wreck hell upon the layout. I thought it was my code so I borrowed a few from tutorials etc with the same results. I've just installed FireFox also, thinking it was a Chrome bug, but that gives the same result too..
http://shanesdomain.byethost32.com/
I might be missing something obvious from lack of sleep, but could anyone assist this?
body { background: url(../images/background.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } #topbar-navigation { width: auto; height: 48px; background: #080d10; position: absolute; margin-left: auto; margin-right: auto; top: 0; left: 0; right: 0; display: inline-block; text-align: center; border-bottom: 1px solid #262b2f; z-index: 1; } #adblock-warning { width: auto; position: absolute; margin-left: auto; margin-right: auto; top: 0; left: 0; right: 0; background: #344152; font-family: 'sinkin_sans400_regular'; color: #b6b6b6; padding-top: 10px; padding-bottom: 10px; margin-top: 49px; text-align: center; font-weight: normal; font-size: 10px; white-space: nowrap; } #maincontainer { width: 960px; height: 1000px; position: absolute; margin-left: auto; margin-right: auto; margin-top: 150px; top: 0; left: 0; right: 0; background: #f2f2f2; } .user-icon-notif { height: 20px; width: 20px; position: absolute; margin-left: auto; margin-right: auto; margin-top: 15px; top: 0; left: 875px; right: 0; } .user-register { height: 20px; width: 20px; position: absolute; margin-left: auto; margin-right: auto; margin-top: 15px; top: 0; left: 815px; right: 0; text-decoration: none; font-family: 'sinkin_sans400_regular'; font-size: 11px; color: #99a0a8; } .user-register:hover { color: #c9c9c9; } .user-login { height: 20px; width: 20px; position: absolute; margin-left: auto; margin-right: auto; margin-top: 15px; top: 0; left: 700px; right: 0; text-decoration: none; font-family: 'sinkin_sans400_regular'; font-size: 11px; color: #99a0a8; } .user-login:hover { color: #c9c9c9; } <!DOCTYPE html> <html> <head> <META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-8"> <META HTTP-EQUIV="content-language" content="EN"> <META NAME="Rating" content="General"> <META NAME="Designer" content="Shane Wilson"> <META NAME="Keywords" content="Gamer, Community"> <META NAME="revisit-after" content="7"> <META NAME="Robots" content="index,follow"> <META HTTP-EQUIV="Cache-Control" content="no-cache"> <META HTTP-EQUIV="Expires" content="0"> <META NAME="Author" content="Shane Wilson"> <link rel="stylesheet" type="text/css" href="css/index.css"> </head> <body> <div id="topbar-navigation"> <a href="register" class="user-register">Register</a> <a href="login" class="user-login">Login</a> </div> <div id="maincontainer"> </div> <script type="text/javascript" src="http://shanesdomain.byethost32.com/js/advertisement.js"></script> <script type="text/javascript"> if (document.getElementById("TestAdBlock") == undefined) { document.write('<div id="adblock-warning">Oops! It looks like you are using AdBlock. We know adverts can be annoying, but in order to keep the site running we have to display them</div>'); } </script> </body> </html> I am getting the following error message: Fatal error: Uncaught Error: Array callback must have exactly two elements in /Users/studio/Sites/BannerProject/b-as/tio-new/__classes/person_form_edit_initial.php:14 Stack trace: #0 /Users/studio/Sites/BannerProject/b-as/tio-new/index.php(78): require() #1 {main} thrown in /Users/studio/Sites/BannerProject/b-as/tio-new/__classes/person_form_edit_initial.php on line 14 for a line in my code that only has the following code: $person_id = $_SESSION('person_id'); This is a simple array assignment. Where is the "two elements" requirement? I"m confused by the "require() #1 {main}" comment in the message. If it refers to a require call in the index.php file, there are also no functions in that file or a file it requires that require two elements. --Kenoli Hi. I made a website to keep track of where I am in various manga. I noticed that sometimes the title I grab looks OK when rendered on the page but in the database it's weird looking
I did a for ($x=0; $x<strlen($title); $x++) loop and dumped $x, char at $ pos and ord of char: 0 = T = 84 1 = h = 104 2 = e = 101 3 = = 32 4 = D = 68 5 = e = 101 6 = m = 109 7 = o = 111 8 = n = 110 9 = = 32 10 = K = 75 11 = i = 105 12 = n = 110 13 = g = 103 14 = � = 226 15 = � = 128 16 = � = 153 17 = s = 115 18 = = 32 19 = D = 68 20 = a = 97 Is there some nifty built in function for converting that weird stuff to a regular apostrophe (and convert any other weird stuff)? I mean, I can write a filter to look for 226/128/153 and replace with ' but I'm sure there must be a proper way to handle that stuff. Thanks! This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=350068.0 |