<?
$data=$_POST[data];
//then from here i want like it so that it checks and if you post from
//and if data is over 5 characters long then it will take you to yes.html
//and if it is 5 or less characters then take you to no.html
?>
<?
echo "";
?>
that is from a post form.
please help me a.s.a.p as i need this pretty urgently and i am not greaty with php. thanks
contact me on aim = jacka18l
or email = jack@parryspad.freeserve.co.uk
simple php if question
Moderator: General Moderators
-
coreycollins
- Forum Commoner
- Posts: 67
- Joined: Sun Feb 01, 2004 1:04 pm
- Location: Michigan
if you looked at that above link, you'd see who simple it was. least make an effort
Code: Select all
<?php
$data=$_POST['data'];
$num = strlen($data);
if ($num >= 5 ) {
//no.html
} else {
// yes.html
)
?>
Last edited by tim on Sun Mar 21, 2004 1:51 pm, edited 2 times in total.
-
coreycollins
- Forum Commoner
- Posts: 67
- Joined: Sun Feb 01, 2004 1:04 pm
- Location: Michigan
We're not really here to right stuff for you, we're here to help you learn php... Just think about it. I'll give you an example:
I didn't test this so it may have an error...
lol Tim beat me to it
Code: Select all
if (strlen($data) >= 5)
{
// do stuff
}
elseif (strlen($data) < 5)
{
// do stuff
}lol Tim beat me to it