RE: [PHP] Help: Undefined variable

2002-12-16 Thread John W. Holmes
Don't double post and do a little thinking for yourself. The error is
undefined variable: Array. That means that where you are using
$Array["URL"], it doesn't have a value, it's, "undefined". Where is
$Array coming from, or where do you think it's coming from?

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

> -Original Message-
> From: New B [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 16, 2002 9:44 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Help: Undefined variable
> 
> Please help!  I am a beginner of php, I got an error from my own
webpage:
> 
> Notice: Undefined variable: Array in
C:\Inetpub\wwwroot\php\HandleForm.php
> on line 23
> Please enter a valid Web address!
> 
> Below is my code:
> 
>  function WriteToFile ($URL, $Description) {
>  /* Function WriteToFile takes two arguments--URL and
Description--Which
> will be written to an external file. */
>   $TheFile = "C:\Inetpub\wwwroot\php\data.txt";
>   $Open = fopen ($TheFile, "a");
>   if ($Open) {
>fwrite ($Open,"$URL\t$Description\n");
>fclose ($Open);
>$Worked = TRUE;
>  } else {
>$Worked = FALSE;
>  }
>  return $Worked;
> }// End of WriteToFile Function.
> ?>
> 
> 
> Using Files
> 
>  /* This page receives and handles the data generated by "form.html".
*/
> $Pattern = "(http://)?([^[:space:]]+)([[:alnum:]\.,-_?/&=])";
> if (eregi($Pattern, $Array["URL"])) {
> <-That is line
23
>  $Replace = "http://\\2\\3\"target=\"_new\";>\\2\\3";
>  $Array["URL"] = eregi_replace($Pattern, $Replace, $Array["URL"]);
>  $CallFunction = WriteToFile ($Array["URL"], $Array["Description"]);
>  if ($CallFunction) {
>   print("Your submision--$Array[URL]--has been received!\n");
>  } else {
>print ("Your submission was not processed due to a system
> error!\n");
>   }
>  } else {
>print ("Please enter a valid Web address!\n");
> }
> ?>
> 
> 
> 
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Help: Undefined variable

2002-12-16 Thread New B
Please help!  I am a beginner of php, I got an error from my own webpage:

Notice: Undefined variable: Array in C:\Inetpub\wwwroot\php\HandleForm.php
on line 23
Please enter a valid Web address!

Below is my code:




Using Files

http://\\2\\3\"target=\"_new\";>\\2\\3";
 $Array["URL"] = eregi_replace($Pattern, $Replace, $Array["URL"]);
 $CallFunction = WriteToFile ($Array["URL"], $Array["Description"]);
 if ($CallFunction) {
  print("Your submision--$Array[URL]--has been received!\n");
 } else {
   print ("Your submission was not processed due to a system error!\n");
  }
 } else {
   print ("Please enter a valid Web address!\n");
}
?>






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php