Jump to content

Archived

This topic is now archived and is closed to further replies.

RonenMymon

Getting 'Notice' messages, but why ??

Recommended Posts

I have like 4 notice messages:
Notice: Undefined index: CName in c:\Inetpub\wwwroot\Test\phpDatabase.php on line 17
Notice: Undefined index: CEmail in c:\Inetpub\wwwroot\Test\phpDatabase.php on line 18
Notice: Undefined index: CTextArea in c:\Inetpub\wwwroot\Test\phpDatabase.php on line 20
Notice: Undefined index: CFlag in c:\Inetpub\wwwroot\Test\phpDatabase.php on line 21

But I've defined the varibels before:
17: $NewName = $_REQUEST["CName"];
18: $NewEmail = $_REQUEST["CEmail"];
19: $NewDate = date('Y-m-d G:i:s');
20: $NewMessage = $_REQUEST["CTextArea"];
21: $flag = $_REQUEST["CFlag"];

What can be the problem ??
(The code is working...)


Thanks !
Ronen

Share this post


Link to post
Share on other sites
I'm assuming there is a form sending this data to your page and when you load the page to display the form you get these messages.

If no data has yet been sent to the page from the form then $_REQUEST["CName"] does not yet exist.

Try

[code]if (isset($_REQUEST["CName"])) {


    $NewName = $_REQUEST["CName"];
    $NewEmail = $_REQUEST["CEmail"];
    $NewDate = date('Y-m-d G:i:s');
    $NewMessage = $_REQUEST["CTextArea"];
    $flag = $_REQUEST["CFlag"];

    # process form data here

}[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.