Jump to content

[SOLVED] How to use $_GET in php?


divadiva

Recommended Posts

Experts

Please help me with this.I am stuck with a problem.

 

I have this :

 

//Basiclaly this is my url www.xyz.local/index.php?entryPoint=removeme&identifier=161f9f7f-1e73-1902-3930-49661416835e
//All I want is to pass entryPoint and identifier.I thought of using $_GET but it doesnt work right.

$fileDir = "http://www.xyz.local/"; // supply a path name.

$fileName = "index.php."; // supply a file name.

	$fileString = $fileDir.'/'.$fileName.'/'.$_GET["entryPoint"].'/'.$_GET["identifier"]; // entry point and identifier is the additional string attached.I want to pass this  string to 

      if(!$fdl=@fopen($fileString ,'r'))


 

Any help will be appreciated.

 

Best Regards

Divya

Link to comment
https://forums.phpfreaks.com/topic/140863-solved-how-to-use-_get-in-php/
Share on other sites

$fileDir = "http://www.xyz.local"; // supply a path name.

 

Since you add an ending slash in the $fileString, do that. Also echo out the $fileString to make sure that path is being populated right. Some debugging would have caught that. ALso this line:

 

   $fileName = "index.php."; // supply a file name.

Should be:
   $fileName = "index.php"; // supply a file name.

 

No ending period.

 

What is the end result that you want from $fileString? Like how should that string look?

Thankyou for replying

 

I want to check whether this is right:

 

$fileString = $fileDir.'/'.$fileName.'/'.$_GET["entryPoint"].'/'.$_GET["identifier"];

 

If I only use this it works as link is there(entryPoint and identifier is the attached string ie ww.xyz.com/entryPoint&identifier

 

$fileString = $fileDir.'/'.$fileName 

 

This is the error.

 

Cannot open the page

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.