pass parameter to php file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bharathv
Forum Newbie
Posts: 4
Joined: Wed Mar 25, 2009 2:12 am

pass parameter to php file

Post by bharathv »

<IMG SRC="test2.php">

hello guys,
i want to pass the parameter to the php file
like

<IMG SRC="test2.php,50">

how to pass this and give any snippet to add in the php to accept the parameter.

thanks in advance.
sujithtomy
Forum Commoner
Posts: 46
Joined: Tue Mar 24, 2009 4:43 am

Re: pass parameter to php file

Post by sujithtomy »

Hello,

HTML

Code: Select all

<a href="test2.php?val=50"><img src="image.jpg"></a>
PHP @ test2.php

Code: Select all

 
<?php
 
$val =  $_REQUEST['val'];
echo $val;  // displays the value 50
 
?>
 
bharathv
Forum Newbie
Posts: 4
Joined: Wed Mar 25, 2009 2:12 am

Re: pass parameter to php file

Post by bharathv »

thank u sujithtomy.
Post Reply