$_GET not working in XAMPP 5.5.30

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:

<?php $name = $_GET['name']; echo 'How are you ' . $name . '?'; ?>

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

$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?

1 Like

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?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.