Your HostICan Community  


Go Back   Your HostICan Community > Programming & Design > PHP / MySQL Assistance

PHP / MySQL Assistance We understand. Not all of you are experienced programmers, but some of you are highly skilled at coding. So we've set aside this forum so you can ask questions, and provide answers to the most commonly asked PHP / MySQL issues.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-10-2009, 11:10 AM
sheba426 sheba426 is offline
Junior Member
 
Join Date: Oct 2009
Posts: 1
Exclamation Not Working?

I do not understand what I am missing or doing wrong. Can anyone see what I am doing wrong?

The goal is to take a zip code from a previous page and see if it is in the database. If not give an error page else continue on.


set_time_limit(0);

include "database.php";

if (($REQUEST_METHOD == "POST") && (!strpos($HTTP_REFERER , "main.php"))) {
$query = "select * from ZipCodes where ZipCode = '$Zip'";
$zip_query = mysql_query($query , $dbh);
$zip_row = mysql_fetch_array($zip_query);

//Want to see if zip_row is null or not.
(echo "")

(if $zip_row) {) ("Location: zipcodeserved.php"); // redirect to zipcode being served page

}else part {
header("Location: zipcodenotserved.php"); // redirect to zipcode not being served page

}

?>
Reply With Quote
  #2  
Old 10-11-2009, 11:13 AM
Vron's Avatar
Vron Vron is offline
Member
 
Join Date: Jan 2009
Posts: 73
Default Re: Not Working?

Place this code in the php.ini file:
Code:
display_errors = On
Run your script, then look for errors in error_log file.
At first glance it seems to me that the line:
PHP Code:
(echo ""
is wrong! I do not see ; at the end.
And do not forget
PHP Code:
<?php
in the beginning.
Reply With Quote
  #3  
Old 10-12-2009, 03:43 AM
carlobee carlobee is offline
Senior Member
 
Join Date: Jul 2009
Posts: 163
Default Re: Not Working?

that would do it.

Reply With Quote
Reply

Tags
working

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 02:46 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Copyright © 2003 - 2008 HostICan. All Rights Reserved.