Jump to content

ratcateme

Members
  • Posts

    1,216
  • Joined

  • Last visited

    Never

About ratcateme

  • Birthday 01/24/1992

Contact Methods

  • MSN
    ratcateme@gmail.com

Profile Information

  • Gender
    Male
  • Location
    Auckland, New Zealand

ratcateme's Achievements

Member

Member (2/5)

0

Reputation

  1. what about this if($newpassword==$confirmnewpassword && trim($_POST['newpassword']) != '') also notice i change the = to a == Scott.
  2. strpos is returning 0 php treats a 0 as false. try changing the ifs to if (strpos($rank[$team], '1<sup>st</sup>') !== false) { and if (strpos($rank[$team], '2<sup>nd</sup>') !== false) { !== checks the type of value as well. Scott.
  3. you could do a query and output like this $result = mysql_query("SELECT Animal FROM animals") or die(mysql_error()); for($i = 1;$row = mysql_fetch_array($result)!=null;$i++){ echo $row['Animal'] . " is at " . $i; } this uses a for instead of a while so you don't need a ID key although i would recommend putting one in Scott.
  4. have you read the sticky on header issues? you need to move the header command to before any output <html> <head> <title>Order Online</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .style1 { font-family: Arial, Helvetica, sans-serif; font-weight: bold; } --> </style> </head> is output and needs to be after the header command also try to use [ code][/code] tags around code Scott.
  5. also what is error reporting set to? it looks to me like maybe error reporting is not set to show errors check you php.ini file but i dont think that is the problem because you got a error printed out but check it anyway Scott.
  6. do you understand how headers work and how php handles them? headers are sent at the top of a HTTP response. so you cannot send headers after any output has been sent because they had to come first now if you read the error output is started on line 5 "<div id="wrapper">" looking at your code i don't quite see how this line of code works with the rest of the script you need. anyway to i would recommend moving the login checker part of the script to the top on the lines after session_start() that way you would have no problems Scott.
  7. you could go say function get_number($number){ while($number > 9) { $number = array_sum(str_split($number)); } return $number; } $sum1 = get_number($number); $bnum=get_number($split_date[0]); Scott.
  8. a quick observation about that math behind this this will also work $number = 58; $number = $number%9; if($number == 0){ $number = 9; } only problem is if the original number is 0 it outputs 9 so might need another if if you are planning on using it with numbers including 9 Scott.
  9. $number = 58; while(strlen($number)!= 1){ $numbers = str_split($number); $number = 0; foreach($numbers as $add){ $number+=$add; } } echo $number; Scott. edit: guess i was beaten and with a better solution. may never terminate? i can't think of a way off the top of my head for that?
  10. looking at that and the PM i still can't see any reasons why it wont update. the only thing i can think of done but have you tired the echo mysql_affected_rows also are there any other if's around the update section that could stop the update from happening? they might need rechecking also try to add say echo "UPDATING NOW"; on the line after the query to make sure it gets to that line? Scott.
  11. well try this mysql_query("UPDATE available SET sex= 'Male' WHERE id = '1'",$con) or die(mysql_error($con)); echo mysql_affected_rows($con); mysql_close($con); are you sure there is a row with an ID of 1 and a sex of Female? other wise you wont see anything Scott.
  12. you missed in my code there is a , after the query and before $con the line you posted missed that out Scott.
  13. try this code <?php $con = mysql_connect("localhost","*********","**********"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("**********", $con); mysql_query("UPDATE available SET sex= 'Male' WHERE id = '1'",$con) or die(mysql_error($con)); mysql_close($con); that will exit if there is a error with your query. and hopefully tell you what is going wrong Scott.
  14. are you sure have you check the source of the html page that your browser is getting? not the source that is on your web server but what is really being sent to the browser Scott.
  15. looking at that i just was thinking you need to escape $'s like this $function = "if(\$me == 2){ echo 'fail';}else{ echo '<input type=\"checkbox\" name=\"list[]\" value=\"\$value\">'; }"; also i think the if and else should be lower case but i don't think it matters Scott.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.