Image

Imagevxjasonxv wrote in Imagephp 😤working

Listens: None

"Why can't it just work?" "Because you wrote it." ">/"

Ok, first couple of things.
I'm working on a site with some friends.
We have cvs all set up and working, but I can't get one stupid little thing to work.

I think my logic may be flawed. Code behind the cut, notes down below.

if(empty($HTTP_POST_VARS[zip])) {
echo "";
$zipquery = mysql_query("SELECT zip FROM ZipCodes WHERE state = '$HTTP_POST_VARS[stateID]' AND city = '$HTTP_POST_VARS[city]';") or die(mysql_error());
if(mysql_num_rows($zipquery) > 0) {
echo "";
$location->zip = addslashes(mysql_result($zipquery,0) or die(mysql_error()));
}
else {
echo "";
$location->zip = addslashes($HTTP_POST_VARS[zip]);
}
}
else {
echo "";
$location->zip = addslashes($HTTP_POST_VARS[zip]);
}
makes Trillian Meow at you.

The javascript alert thing is a debug thing for me, since it refuses to work, I'll see how far it gets.

This may be a cvs thing, I don't know.

So:
1) The Alert boxes never appear.
2) We have a database of zip codes, and I've run that EXACT query (well, with a proper city and state of course) against the DB, and have gotten results. Then mirrored them on the website, and they refuse to work.
3) The zip code refuses to fill itself in automatically...
Everything else we have in the class works. The zip code used to work, when it's only function was to take what the user entered into the form and put it online.
Now it won't appear at all, and it pisses me off to no end.

Any suggestions?