PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 1st, 2013, 07:29 AM
emilagren emilagren is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 14 emilagren User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 9 m 22 sec
Reputation Power: 0
PHP-General - Pass variable in link from one PHP page to another

So, I will go directly to the problem. I'm trying to pass a variable with a URL like this:
PHP Code:
echo "<a href='editImage.php?liink=$link2'>Edit</a>"

where the variable $link2 is a link to an image. This works fine, the problem is when I'm trying to use $_REQUEST in editImage.php to catch the variable.
In editImage.php I do this:
PHP Code:
 $liink $_REQUEST["liink"]; 

But $liink does not receive a value, it's empty. After this I just want to put the variable in a query and execute the query. When doing this I get this message from the browser:
Code:
Notice: Undefined index: liink in /path/editImage.php on line 20

where line 20 is the above REQUEST line. I have also tried this with $_GET but it's not working.

I have searched on the forum and on google but I can't solve this one. Please help me, I would appreciate it so much.

Reply With Quote
  #2  
Old January 1st, 2013, 08:45 AM
gw1500se gw1500se is online now
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,907 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 1 Month 23 h 52 m 18 sec
Reputation Power: 581
$_GET is the right variable to use. Make sure the URL contains what you expect.
PHP Code:
echo "<pre>";
print_r($_GET);
echo 
"</pre>"
__________________
There are 10 kinds of people in the world. Those that understand binary and those that don't.

Last edited by gw1500se : January 1st, 2013 at 08:48 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP-General - Pass variable in link from one PHP page to another

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap