Undefined variable

Nismo83

OSNN AZN Addict
Joined
13 Mar 2004
Messages
384
Notice: Undefined variable: action in c:\inetpub\wwwroot\login.php on line 3


Code:
<?php

if($action == "setcookie")
{
setcookie("visitorname", $visitorname, time() + 3600);
}

if(isset($visitorname)):

?>

Welcome <B><? echo $visitorname ?></b>

<? else: ?>

<form>

<input type ="hidden" name="action" value="setcookie">
Welcome, you name please <input type="text" name="visitorname"><br>
<input type="submit" value="OK">
</form>

<? endif; ?>

okie..what's wrong with it?:( i cant get it running.

I am currently {
61217616
| |
intrigue_alvin83@hotmail.com
| |
alvinauboonhock
}
=========================
Intel P4 1.5 Ghz
Intel D850GB MOBO
256MB PC 800 RDRAM
20GB Maxtor HDD (5400 RPM)
40GB Maxtor HDD (7200 RPM)
52X Creative CDROM
8X4X32 Creative CDRW
16X ASUS DVD ROM
Iomega 100 MB USB Zip Drive
SYBA Ultra ATA IDE controller card
SB live 5.1 DE
Aging Gainward 64MB GF2MX400 --> | Upgrading to GF4 Ti4 series |
Altec Lansing ACS 56
Dlink D538TX NIC

=========================
 
Undefined variable error reporting is just unnecessary in PHP. Most of my pages acctually rely on a variable not being defined. Try turning off error reportings of warnings in php.ini.

You also might want to tell the form-tag what it should do (action, method).
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back