Page 1 of 1

pass parameter to php file

Posted: Wed Mar 25, 2009 2:28 am
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.

Re: pass parameter to php file

Posted: Wed Mar 25, 2009 2:35 am
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
 
?>
 

Re: pass parameter to php file

Posted: Wed Mar 25, 2009 5:49 am
by bharathv
thank u sujithtomy.