Asked by duncanb7
at 2024-04-27 01:52:46
Point:500 Replies:14 POST_ID:828489USER_ID:11059
Topic:
Hypertext Markup Language (HTML);;PHP Scripting Language
I am using $file_url =file_get_contents("http://www.othersite.com/test.aspx?Sybmol=10') in php that
is working fine and I can echo the contents from $file_url,
Since I would like to program the Symbol in Link , so we put it into variable such as $a
$a=10;
$file_url =file_get_contents("http://www.othersite.com/test.aspx?Sybmol='.$a);
echo $file_url;
But it fail to echo; and me give error message <h1>Bad Request (Invalid Header Name)</h1>
and I try to $file_url =file_get_contents("http://www.othersite.com/test.aspx?Sybmol='.constant($a));
and it is also failed and warn it constant() is not made;
Why? Please advise
Also I want to know when we will use constant() in php, what is advantage over using variable ?
Duncan
is working fine and I can echo the contents from $file_url,
Since I would like to program the Symbol in Link , so we put it into variable such as $a
$a=10;
$file_url =file_get_contents("http://www.othersite.com/test.aspx?Sybmol='.$a);
echo $file_url;
But it fail to echo; and me give error message <h1>Bad Request (Invalid Header Name)</h1>
and I try to $file_url =file_get_contents("http://www.othersite.com/test.aspx?Sybmol='.constant($a));
and it is also failed and warn it constant() is not made;
Why? Please advise
Also I want to know when we will use constant() in php, what is advantage over using variable ?
Duncan