| | |
Passing a value via href - php
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2006
Posts: 3
Reputation:
Solved Threads: 0
I recently started working with PHP, and MySQL. And I have come with a little problem, I have tried a couple of things to solve it and they are not working. Well, basically I am trying to put a link on a page, but that page requires me to pass a value, here's an example below, e.g.
If I am on this page for example
and I want to add a link, that would translate to
How do I accomplish this, how do I pass the php variable "prop_id" to a href link? Can someone shed me some light on this matter? Thanks a lot
If I am on this page for example
PHP Syntax (Toggle Plain Text)
http://www.mypage.com/view.php?prop_id=5
PHP Syntax (Toggle Plain Text)
<a href="submit_docs.php?prop_id=5 ">Click </a>
•
•
Join Date: Apr 2006
Posts: 3
Reputation:
Solved Threads: 0
•
•
•
•
Um, you do it exactly like you have indicated in your link. I'm not certain what your question is exactly. Are you unsure how to build the link string? Unsure how to retrieve the value in the target page? Please elaborate a bit.
•
•
•
•
If I am on this page for example
and I want to add a link, that would translate toPHP Syntax (Toggle Plain Text)
http://www.mypage.com/view.php?prop_id=5
How do I accomplish this, how do I pass the php variable "prop_id" to a href link? Can someone shed me some light on this matter? Thanks a lotPHP Syntax (Toggle Plain Text)
<a href="submit_docs.php?prop_id=5 ">Click </a>
If you want to you use prop_id from view.php url in link :
php Syntax (Toggle Plain Text)
$prop_id = '$_GET[prop_id]'; echo "<a href=\"submit_docs.php?prop_id=".$prop_id."\">Click </a>";
- Mitko Kostov
Last edited by MitkOK; Aug 15th, 2007 at 5:59 pm.
•
•
Join Date: Apr 2006
Posts: 3
Reputation:
Solved Threads: 0
•
•
•
•
What do you mean by trabslate ?
If you want to you use prop_id from view.php url in link :
php Syntax (Toggle Plain Text)
$prop_id = '$_GET[prop_id]'; echo "<a href=\"submit_docs.php?prop_id=".$prop_id."\">Click </a>";
- Mitko Kostov
By using the code: php Syntax (Toggle Plain Text)
echo "<a href=\"submit_docs.php?prop_id=".$prop_id."\">Click </a>";
I get the link with the prop_id variable. However I want to point something out, if I try to use for example
php Syntax (Toggle Plain Text)
$varid_id = '$_GET[prop_id]';
Again thanks a lot
•
•
•
•
I get the link with the prop_id variable. However I want to point something out, if I try to use for example
And used $varid_id instead of $prop_id I get an error, In other words, I did not have to declare $prop_id to use it in the link.php Syntax (Toggle Plain Text)
$varid_id = '$_GET[prop_id]';
Again thanks a lot
•
•
Join Date: Apr 2009
Posts: 13
Reputation:
Solved Threads: 0
•
•
•
•
Um, you do it exactly like you have indicated in your link. I'm not certain what your question is exactly. Are you unsure how to build the link string? Unsure how to retrieve the value in the target page? Please elaborate a bit.
I have the similar prrob as described by Binary . But i want to edit any row value displayed in a form in the form of a table . Now i want to edit a specific field after selecting. But If I put an edit link before each row or whatever , how can i pass the relavent variable values to the called form... I want to know the syntax or in simple words i want to send variables in a link string.
Supoz i have
PHP Syntax (Toggle Plain Text)
echo "<td>".$row['lname']."</td>";
Please help me
Thanks
![]() |
Similar Threads
- Open In New Window Php (PHP)
- PHP Templates (PHP)
- Searching multiple fields... (PHP)
- How to do video rating using php? (PHP)
- PHP parsing error, unexpected '<' (PHP)
- XHTML with PHP validation ??? (HTML and CSS)
- Passing variables to and from PHP (JavaScript / DHTML / AJAX)
Other Threads in the PHP Forum
- Previous Thread: Curl function to select options from a select box and auto submit
- Next Thread: how to validate value in drop down menu in php
| Thread Tools | Search this Thread |
.htaccess alerts apache api archive array autocomplete beginner binary broken cakephp checkbox class cms code convert cron curl database dataentry date display duplicates dynamic echo email emptydisplayvalue error execute explodefunction file files firstoptioninphpdroplist folder form forms function functions google hack href htaccess html htmlspecialchars image include insert ip javasciptvalidation javascript joomla keywords limit link login mail matching menu methods mlm multiple mysql network object oop paypal pdf php problem query radio random recursion recursive redirect remote script search securephp server sessions shot sms source space sql subscription syntax system table tutorial tutorials update upload url validator variable video web youtube






