Jump to content

install new apache error on _GET


sungpeng

Recommended Posts

http://localhost/link.php?course=fitness

 

link.php

<?php
$course=$_GET[course];
echo "$course";
?>

 

I install the new apache it come out with this error "Use of undefined constant course - assumed 'course' in C:\xampp\htdocs\link.php on line 2".

Previouly it is working fine on old one.

Why it happened on new apache?

Link to comment
https://forums.phpfreaks.com/topic/251891-install-new-apache-error-on-_get/
Share on other sites

Previouly it is working fine on old one.

 

Correction, it was just as broken on the old one.  You just had your error reporting level set to not show notices.

 

Array keys which are strings have to be quoted:

$course=$_GET['course'];
echo $course;

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.