Jump to content

Getting 'Notice' messages, but why ??


RonenMymon

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
Link to comment
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]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.