My form action is set to a php file like this:
<form name="addstudent" action="includes/data.php?act=enquiry" >
<input type="text" name="studentname" class="univtext default" value="Name" />
<input type="text" name="studentemail" class="univtext default" value="Email" />
<input type="text" name="studentno" class="univtext default" value="Contact No." />
<input type="hidden" name="active" value="enquiry" />
<input type="submit" value="Apply" class="univbut" >
</form>
and my php file data.php is:
<?php
switch($_GET['act'])
{
case "enquiry":
include_once('globalvariables.php');
$dataUrl='http://localhost:8080/databasee/track?country='.SITE_ACCESS_COUNTRY.'®ion=delhi';
$json=file_get_contents($dataUrl);
echo $dataUrl;
echo($json);
}
?>
My dataurl is formed correctly but file_get_contents() function is not getting the value from the url (this url returns json true or false) in other cases it working fine, it’s just here I am not able to get it working.
I found that ®ion parameter in my url converts to ®ion.
Try:
See: If you’re opening a URI with special characters, such as spaces, you need to encode the URI with urlencode().
Hope it helps