...

View Full Version : Check to see if post



TrainReq
02-26-2007, 01:36 AM
What is the query to run to basically to see if a value was posted in "username" ... basicly here is what I need to do

If ANY value is posted to Username ($_POST['username']) , dont do anything.... if there isnt a value posted to username header("location: http://google.com");

papa_face
02-26-2007, 01:52 AM
if (!isset($_POST['username']))
{
header("location: http://google.com");
}

TrainReq
02-26-2007, 02:06 AM
hm... is that to make it header: location if there ISNT anything posted? because that is what I want to do... if there is something posted, dont do anything...

papa_face
02-26-2007, 02:13 AM
That will make it so that if nothing is posted to username it will go to that url.

CFMaBiSmAd
02-26-2007, 02:24 AM
If the input field is a type="text", it will be set to an empty string upon submission. An isset() test of this type of input field will always be TRUE.

You should use the empty() test or test it against an empty string ""



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum