blink359 Posted April 27, 2009 Share Posted April 27, 2009 I made a website with PhP scripts but when the website was put in my mates server it didnt work and gave lots of errors but when i uploaded same scripts to my linux server it worked What is wrong? Thanks, Blink359 Quote Link to comment https://forums.phpfreaks.com/topic/155855-my-php-doesnt-work-on-other-computers/ Share on other sites More sharing options...
sloth456 Posted April 27, 2009 Share Posted April 27, 2009 could be a whole bunch of things. You should post the code that is creating the errors and copy and paste the errors for us to see. Quote Link to comment https://forums.phpfreaks.com/topic/155855-my-php-doesnt-work-on-other-computers/#findComment-820323 Share on other sites More sharing options...
blink359 Posted April 27, 2009 Author Share Posted April 27, 2009 Kk will do one at a time cos theres a few pages and it would be easier one at a time please wait a few mins Quote Link to comment https://forums.phpfreaks.com/topic/155855-my-php-doesnt-work-on-other-computers/#findComment-820324 Share on other sites More sharing options...
mrMarcus Posted April 27, 2009 Share Posted April 27, 2009 Kk will do one at a time cos theres a few pages and it would be easier one at a time please wait a few mins why wouldn't you just do that right off the bat .. save people's time. with your initial post, how is anybody really supposed to know what is going on, unless somebody, out of sheer chance, has had the exact same problem as you. best to come prepared, post what you know .. what errors are happening .. the messages associated with those errors .. and what you're trying to accomplish. Quote Link to comment https://forums.phpfreaks.com/topic/155855-my-php-doesnt-work-on-other-computers/#findComment-820326 Share on other sites More sharing options...
blink359 Posted April 27, 2009 Author Share Posted April 27, 2009 Sorry <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- .style1 {font-size: small} #apDiv1 { position:absolute; left:37px; top:210px; width:169px; height:30px; z-index:1; } body { background-color: #999999; } .cssnav { position: relative; font-family: arial, helvetica, sans-serif; background: url(images/overbtn.jpg) no-repeat; white-space: nowrap; display: block; width: 250px; height: 50px; margin: 0; padding: 0; } .cssnav a { display: block; color: #000000; font-size: 11px; width: 250px; height: 50px; display: block; float: left; color: black; text-decoration: none; } .cssnav img { width: 250px; height: 50px; border: 0 } * html a:hover { visibility:visible } .cssnav a:hover img { visibility:hidden } .cssnav span { position: absolute; left: 53px; top: 15px; margin: 0px; padding: 0px; cursor: pointer; width: 250px; } .style4 {font-size: 16px} --> </style> </head> <body> <center><table width="80%" border="1" align="center"> <tr> <th height="186" colspan="5" align="left" valign="top" scope="row"><img src="file:///C|/Documents and Settings/Administrator/Desktop/Images/logo2.jpg" width="944" height="215" /></th> </tr> <tr> <th width="25%" rowspan="2" align="left" valign="top" scope="row"><h2> <div class="cssnav"><a href="index.html" title=""><img src="images/downbtn.jpg" alt="" /><span class="style4">Home</span></a></div> <div class="cssnav"><a href="Register.php" title=""><img src="images/downbtn.jpg" alt="" /><span class="style4">Create Account</span></a></div> <div class="cssnav"><a href="phpbb3/index.php" title=""><img src="images/downbtn.jpg" alt="" /><span class="style4">Forums</span></a></div> <div class="cssnav"><a href="vote.php" title=""><img src="images/downbtn.jpg" alt="" /><span class="style4">Vote</span></a></div> <div class="cssnav"><a href="donate.html" title=""><img src="images/downbtn.jpg" alt="" /><span class="style4">Donate</span></a></div> <div class="cssnav"><a href="character.html" title=""><img src="images/downbtn.jpg" alt="" /><span class="style4">Account Tools</span></a></div> <br /> </h2> </th> <td colspan="3" rowspan="3" valign="top"> <center><form method="post" action=""> <p> <?php $dbhost = "localhost"; $dbuser = "root"; $dbpass = "ascent"; $dbname = "logon"; mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname); $success = true; $problemMessage = ""; if (isset($_POST['Submit'])) { if(!$user || !$pass || !$pass2) { $problemMessage .= "Please complete all required data <br />"; $success = false; } if(strlen($user) < 5) { $problemMessage .= "User must be more that 5 characters <br />"; $success = false; } if(strlen($user) > 20) { $problemMessage .= "Your username cannot be longer than 20 characters <br />"; $success = false; } if($pass != $pass2) { $problemMessage .= "Your passwords do not match <br />"; $success = false; } if(strlen($pass2) < 5) { $problemMessage .= "Your password must be more than 5 characters<br />"; $success = false; } if(strlen($pass2) > 20) { $problemMessage .= "Your password cannot be longer than 20 characters <br />"; $success = false; } $result = mysql_query("SELECT * FROM `accounts` where login='$user';") or die("Error: (" . mysql_errno() . ") " . mysql_error()); $row = mysql_fetch_array( $result ); if(isset($row)) { $problemMessage .= "The username already exists <br />"; $success = false; } if ($success) { echo "Valid New Account Entry<br />"; $result = mysql_query("INSERT INTO `accounts` VALUES ('', '$user', '$pass2', '', '', '0', '9', '', '', '$flag', 'enUS', '0', '0', null);") or die("Error: (" . mysql_errno() . ") " . mysql_error()); } $row = mysql_fetch_array( $result ); } ?> <?php if ($success == false) { echo $problemMessage; } ?> Account Creation Page<br> Username: <input name="user" type="text"/> <br> Password: <input name="pass" type="text"/> <br> Repeat Password: <input name="pass2" tpye="text"/> <br /> Pre TBC <input type="radio" name="flag" value="0"> <br> TBC Enabled <input type="radio" name="flag" value="8"> <br> Wotlk Enabled <input type="radio" name="flag" value="24"> <br> <input name="Submit" type="submit" value="submit" /> </p> <imput name="reset" type="reset" value="reset" /> <?php $user = $_POST['user']; $pass = $_POST['pass']; $pass2 = $_POST['pass2']; $flag = $_POST['flag']; ?> </form></center></td> <td width="22%" height="114">Login to forums</td> </tr> <tr> <td height="129" valign="top"><p class="style1">Donate now to keep our server up</p> <p class="style1"><a href="http://www.paypal.com"><img src="Images/Paypal.png" width="207" height="87" /></a></p></td> </tr> <tr> <th height="224" valign="top" scope="row"><br /></th> <td><p> </p> </td> </tr> <tr> <th height="33" colspan="5" scope="row"> </th> </tr> </table> </center> </body> </html> on submit it just does all errors and inserts nothing into the database Quote Link to comment https://forums.phpfreaks.com/topic/155855-my-php-doesnt-work-on-other-computers/#findComment-820329 Share on other sites More sharing options...
Axeia Posted April 27, 2009 Share Posted April 27, 2009 you left your password in there.. Knowing what errors are put out would help to. Quote Link to comment https://forums.phpfreaks.com/topic/155855-my-php-doesnt-work-on-other-computers/#findComment-820333 Share on other sites More sharing options...
premiso Posted April 27, 2009 Share Posted April 27, 2009 Does your friends computer have the same database? Does it have the same version of PHP? Perhaps posting some of the errors would help. My bet is you did not re-create the database on his computer like you would need to for this to work. Quote Link to comment https://forums.phpfreaks.com/topic/155855-my-php-doesnt-work-on-other-computers/#findComment-820334 Share on other sites More sharing options...
laffin Posted April 27, 2009 Share Posted April 27, 2009 did ur friend run the prescribed script after installing php? <?php phpinfo(); ?> Yer using long tags which is good, but ya fail to mention the errors. we arent mind readers. check yer apache logs for errors check yer php logs for errors Quote Link to comment https://forums.phpfreaks.com/topic/155855-my-php-doesnt-work-on-other-computers/#findComment-820335 Share on other sites More sharing options...
blink359 Posted April 27, 2009 Author Share Posted April 27, 2009 Sorry worded it wrong it echos out all if errors etc Quote Link to comment https://forums.phpfreaks.com/topic/155855-my-php-doesnt-work-on-other-computers/#findComment-820340 Share on other sites More sharing options...
premiso Posted April 27, 2009 Share Posted April 27, 2009 Sorry worded it wrong it echos out all if errors etc Your version of PHP has register_globals turned on, his has them off. You should use the superglobals ($_GET['user'] or $_POST['user']) instead of $user to grab information submitted from a form. This is why you use those, cause register_globals should be turned off for security reasons and it is being depreciated in PHP 6. I thought that you were told to do this in another thread. Seems like you disregard important information very easily. Quote Link to comment https://forums.phpfreaks.com/topic/155855-my-php-doesnt-work-on-other-computers/#findComment-820346 Share on other sites More sharing options...
laffin Posted April 27, 2009 Share Posted April 27, 2009 What errors? web server errors browser errors php errors Thats like calling yer car mechanic and saying "My car dun work, what's wrong with it?" if you dun know the sympotons, how is he gonna give u a diagnisis. and web server/php gives u a log for these errors. so makes yer job a lot eaier. Quote Link to comment https://forums.phpfreaks.com/topic/155855-my-php-doesnt-work-on-other-computers/#findComment-820347 Share on other sites More sharing options...
blink359 Posted April 27, 2009 Author Share Posted April 27, 2009 Sorry worded it wrong it echos out all if errors etc Your version of PHP has register_globals turned on, his has them off. You should use the superglobals ($_GET['user'] or $_POST['user']) instead of $user to grab information submitted from a form. This is why you use those, cause register_globals should be turned off for security reasons and it is being depreciated in PHP 6. I thought that you were told to do this in another thread. Seems like you disregard important information very easily. Thanks ill try that Does that also mean i have to change it where it says $dbhost = "localhost"; $dbuser = "root"; $dbpass = "ascent"; $dbname = "logon"; mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname); Quote Link to comment https://forums.phpfreaks.com/topic/155855-my-php-doesnt-work-on-other-computers/#findComment-820367 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.