Topic awaiting preservation: More obvious answers you hate to give (PHP) |
|
---|---|
Author | Thread |
Nervous Wreck (II) Inmate From: Juneau, Alaska |
posted 07-09-2004 02:01
Just for the record, I'm not one to ask other people to debug my code for me, but I've been looking at this for over an hour, and no answer has come. I'm trying to create a form that takes a URL and creates a clickable link (even adding an http:// and an <A HREF.. all that good stuff). However, I always get this error, followed by a very half-assed version of my intended results.. quote:
quote:
quote:
|
Bipolar (III) Inmate From: Australia |
posted 07-09-2004 02:28
Generally when you get out of range things its because you are trying to get to invalid bounds of an array. (or something doesnt exist etc) code: print ("Your submisson--$Array[URL]--has been received!<BR>\n");
code: print ("Your submisson--" . $Array["URL"] . "--has been received!<BR>\n");
|
Paranoid (IV) Inmate From: [s]underwater[/s] under-snow in Juneau |
posted 07-09-2004 07:19
I don't see any place where you are populating the $Array[] array. My bet is that you have no values for $Array["FirstName"] or code: if (isset($_POST['submit'])){
|
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 07-09-2004 09:13
would any of you guys count? |
Bipolar (III) Inmate From: Australia |
posted 07-09-2004 16:16
Yeh i missed a line, but he is still missing quotation marks when he is calling that part of the array, i wouldnt be suprised if it gave an error. Or does this work when the entire line is in quotation marks? Not sure why you need an array there anyhow, bit strange if you are only taking in one set of variables? Do you really get an advantage from it. But thats irrelevant here... |
Nervous Wreck (II) Inmate From: Juneau, Alaska |
posted 07-09-2004 18:16
code: print ("Your submisson--" . $Array["URL"] . "--has been received!<BR>\n");
quote:
code: URL <INPUT TYPE=TEXT NAME="Array[URL]" SIZE=60><BR>
quote:
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 07-09-2004 18:47
You should always put quotes around your associative names. I don't care what that book says. Unquoted hash keys indicate that the key is a constant and is a bad code practice. Use single quotes instead of doubles if you're worried about it. code: print ("Your submisson--" . $Array['URL'] . "--has been received!<BR>\n");
|
Nervous Wreck (II) Inmate From: Juneau, Alaska |
posted 07-12-2004 18:32
code: print ("Your submisson--" . $Array['URL'] . "--has been received!<BR>\n");
quote:
|