Jump to content

Passing variables through URL


swampone

Recommended Posts

Im trying to pass multiple variables to a URL. I am able to get the first URL through, but not any others.

 

$link_b = ("<a href=\"view.php?vkey=".$vkey."&title=".$meta."\">".$meta."</a>");

 

The value of vkey is seen in the url, but the value of title is not. The URL i get looks like the following:

 

http://localhost/view.php?vkey=765297369

 

I need it to look like the following, so i can have access to variables on the new page:

 

http://localhost/view.php?vkey=765297369&title=$meta

 

Link to comment
Share on other sites

Not sure why, but when I swapped the two variables around, it works just how I want it to.

<?php
//shows both the values of title and vkey
$link_b = "<a href=\"view.php?title={$meta}&vkey={$vkey}\">{$meta}</a>";

//Only give me the value of vkey
$link_b = "<a href=\"view.php?vkey={$vkey}&title={$meta}\">{$meta}</a>";

?>

Link to comment
Share on other sites

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.