Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pass variable from href to another php page

Tags:

php

mysql

.I have this code:

<a id="various3" href="picture.php?id=',$pid,'" title="'.$info.'"><img src="picture.php?id=',$pid,'" width="150" height="210"></a>

it passes the id to my picture.php where i use it on a query string.

$sql = sprintf("select pics, ext from `06-07` where id='%d'",$_GET['id']);

Is it possible to pass more than one variable using this method? because i would like to pass "dept" along with the "id". if it is then how?

I have tried this:

<a id="various3" href="picture.php?id=',$pid,'&dept=',$dept,'" title="'.$info.'"><img src="picture.php?id=',$pid,'&dept=',$dept,'" width="150" height="210"></a> 

with matching

$sql = sprintf("select pics, ext from 06-07 where id='%d' AND dept='%s'", $_GET['id'], $_GET['dept']); but it doen't work. what's wrong?
like image 418
zerey Avatar asked Feb 09 '26 15:02

zerey


1 Answers

<a href="test.php?page_name=<?php echo $this_month; ?>">

access this on another page by get method:

$file_name = $_GET['page_name'];
like image 80
laxmi kalake Avatar answered Feb 12 '26 15:02

laxmi kalake



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!