Jump to content

Corona4456

Members
  • Posts

    244
  • Joined

  • Last visited

    Never

Everything posted by Corona4456

  1. Just combine both of your while loops into one.  However, instead of echoing... create a string and just keep concatenating it as follows: [code] <?php echo '<form name="type1" method="post" action=""> <select name="type"> <option value="NULL" selected>- - - - - - - </option>'; $col1 = '<form name="type1" method="post" action=""> <select name="type"> <option value="NULL" selected>- - - - - - - </option>';         $col2 = '<form name="cat1" method="post" action=""> <select name="cat"> <option value="NULL" selected>- - - - - - - </option>'; while ($row = mysql_fetch_array($result)) { $col1 .= '<option value="'.$row['type'].'">'.$row['type'].'</option>';                 $col2 .= '<option value="'.$row['cat'].'">'.$row['cat'].'</option>';   }   $col1 .= '</select></form>';                 $col2 .= '</select></form>';           // Now just echo them where ever you need them :) ?> [/code] Crap... looks like someone beat me to it :)
  2. It could have to do with register globals.  If register globals is off in your config at work but on at your home site then that could be the problem.
  3. Yep :) That's what the truncate command is :).
  4. Yeah nothing looks wrong about it.  Odds are the whole disabling cookies theory may be correct.  I really can't think of anything else that could be a problem.
  5. you can truncate the table but that deletes every entry in your table, however it does reset everything
  6. Try this for your query instead: [code] $sql="SELECT * FROM `members` WHERE `name` = '$name'"; [/code]
  7. I'm not sure what would be the cause. It's odd that it works in Firefox/Mozilla and Opera but not IE.  Can you echo the string passed to the header() function and see what it is.  Maybe it's something weird with that string that IE can't handle properly.  I see nothing wrong with the code.
  8. OK... I'm confused as to why you aren't using mysql_num_rows(). so you would do: [code] mysql_connect($dbhost, $dbuser, $dbpass) or die('Database has gone bye bye'); mysql_select_db($dbname) or die('Where oh where is that database'); $sql="SELECT * FROM 'members' WHERE 'name' = '$name'"; $results = mysql_query($sql); $row = mysql_fetch_array($results); // Change is here $num_rows = mysql_num_rows($results); //start HTML code for display of profile if ($num_rows == 0) { echo "<font class='bodytext'>'We are sorry. That profile is unavailable at this time. Please select another.<br />"; } else { echo <<<HTML [/code]
  9. Well php may run fine but is the php mysql extension running or enabled?
  10. Hard to debug this not knowing the tables but try doing this since you are sure the table names are exactly the same: [code] "INSERT INTO agent (`name`, `lname`, `email`, `phone`, `cell`, `pass`) VALUES ('$name', '$lname', '$email', '$hphone', '$cphone', '$pass')" [/code] Not sure if that will fix it but I would check again and make sure that the field names are really in the table you are using.
  11. Using php you can easily redirect.  In your php code just check to see what button was set in your $_POST variables. [code] if($_POST['buttonname1']){   header("Location: redirect1.html"); } else if($_POST['buttonname2']){   header("Location: redirect2.html"); } [/code]
  12. Yes it is possible to do.  There are different ways to do it depending on what action you want to happen when either or is clicked.  You can use Javascript to handle client side changes on the page or php if it requires the server to handle the submission of the form.
  13. Heh... no problem I do that kind of thing all the time... so when I look at other's code that's the first thing I look at to make sure that isn't the root of the problem.
  14. Well if this is an exact copy of the code.  You aren't closing the if statement: [code]if ($password != $passcheck)   {       throw new Exception('The passwords you entered do not match.'); [/code]
  15. Try: [code]if(isset($_COOKIE['metalrate'.$id]) == $id)[/code] Instead of: [code]if(isset($_COOKIE['metalrate$id']) == $id)[/code]
  16. Well assuming that 10 is the highest you can get ... you can do: SELECT * FROM `tablename` WHERE `score` >= '9' Or you you can do: SELECT * FROM `tablename` WHERE `score` >= '9' AND `score` <= '10'
  17. I searched around for an answer but I wasn't able to find one so if you can point me to a solution that would be great or if you can solve this problem then that would be great too. Ok, here is my problem. Well first thing is first here are the webserver specs: Windows XP Professional w/ SP2 PHP 5.1.2 MySQL 5.0.18 Apache 2.0.55 Now on to the problem. I'm trying to use the date function. and when I do: [code] <?php   echo date("Y-m-d H:i:s T I"); ?> [/code] I get an hour time difference from my server. My server is set to use DST but ever since the time change in April occured the PHP date function has been returning the time 1 hour behind. For example, when I run it I get: 2006-05-03 23:37:31 MST 0 When I expect: 2006-05-04 0:37:31 MDT 1 It's not a HUGE problem but something I would definitely like to get fixed (if possible). I've tried setting the time zone by editing the php.ini file but it didn't seem to do anything. So if anyone has a solution to this problem or if you need more info please let me know. Thanks in advance.
×
×
  • 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.