Corona4456
Members-
Posts
244 -
Joined
-
Last visited
Never
Everything posted by Corona4456
-
creating 2 drop down menues from the same table
Corona4456 replied to spires's topic in PHP Coding Help
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 :) -
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.
-
Yep :) That's what the truncate command is :).
-
Form had been processed but it did not redirect the page
Corona4456 replied to omerta's topic in PHP Coding Help
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. -
Trying to get 'IF' statement to work with query results
Corona4456 replied to simcoweb's topic in PHP Coding Help
n/p -
you can truncate the table but that deletes every entry in your table, however it does reset everything
-
Trying to get 'IF' statement to work with query results
Corona4456 replied to simcoweb's topic in PHP Coding Help
Try this for your query instead: [code] $sql="SELECT * FROM `members` WHERE `name` = '$name'"; [/code] -
Form had been processed but it did not redirect the page
Corona4456 replied to omerta's topic in PHP Coding Help
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. -
Trying to get 'IF' statement to work with query results
Corona4456 replied to simcoweb's topic in PHP Coding Help
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] -
Glad it worked! :D
-
Well php may run fine but is the php mysql extension running or enabled?
-
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.
-
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]
-
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.
-
error fixed, but extra clarification needed... see reply 7
Corona4456 replied to disoriented guy's topic in PHP Coding Help
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. -
error fixed, but extra clarification needed... see reply 7
Corona4456 replied to disoriented guy's topic in PHP Coding Help
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] -
Try: [code]if(isset($_COOKIE['metalrate'.$id]) == $id)[/code] Instead of: [code]if(isset($_COOKIE['metalrate$id']) == $id)[/code]
-
SELECT * WHERE row "is between 9 and 10"?
Corona4456 replied to DaveLinger's topic in PHP Coding Help
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' -
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.