Please can anyone assist? $_GET and $_POST arrays worked perfectly well in an earlier version XAMPP but when my system crashed and I had to install XAMPP 5.5.30 both arrays do not work.
Can you provide details of what is actually wrong. Just saying the GET and POST arrays âdo not workâ isnât going to help someone help you.
I have 2 files name.html and name.php. In name.html I have the link:
<a href="name.php?name=Eteyen">Hello Eteyen</a>
while in name.php I have:
When I click the link in name.html I have a blank page.
Odd. Does everything else work? PHP functions, etc?
I tried the date function and it worked?
You have a totally blank page, or a page that just says âHow are you ?â with no name? If you go directly to the page from your browser address bar with the name in place, does it work differently?
Totally blank page.
Have you tried just doing something like
<?php
$name = 'Bob';
echo 'How are you ' . $name . '?';
?>
And seeing if that displays? Thatâd isolate the $_GET usage as the problem, maybeâŚ
Is there nothing at all in view-source?
Is the problem due to two different files with the same name but with different extensions being involved, one â.htmlâ and the other â.phpâ?
Shows webpage is not available.
webpage not available
Is your apache/php running correctly? Do you know?
Sorry, my Apache was not started when I changed from $name = $_GET[ânameâ]; to $name = âEteyenâ;. The latter is now working but the former still does not work.
view source:
<?php $name = $_GET['name']; echo 'How are you ' . $name . '?'; ?>Thanks, that explains it.
The file is not getting parsed by the PHP engine.
The browser sees â<?phpâ as an HTML tag it doesnât recognize and so nothing inside of it is rendered.
Are you trying to put PHP code inside of a â.htmlâ file without having added the extension to the ini?
the view page source for the following:<?php echo 'Today\'s date is '. date('l F jS Y.'); ?> is this:
Todayâs date is Monday November 2nd 2015.
This works alright, why not other functions?
Check the file names of those pages - obviously one has a filename that gets it parsed as PHP and the other doesnât.
Please what is the way forward?
Thanks.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.