Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.