I am new (bie?) to PHP. I try to convert some JavaScript code to PHP. How do I call a PHP function from my HTML link? I wrote a function ShowImage($ImgName) in side the ShowImg.php, and test with
$ImgName = "01.jpg";
by call from another PHP program, the function work fine, but I do not know how to call function ShowImage($ImgName) and pass the param to PHP from my HTML link. Please HELP
Thank you.
Call PHP Function for HTML Page
Moderator: General Moderators
Call PHP Function for HTML Page
Last edited by PHIEUDZU on Mon Oct 14, 2002 11:02 am, edited 1 time in total.
does Sticky: Before Post Read: Frames, JavaScript, and PHP Overview answer the question? 
Thanks Takuma and Volka, but that is not what I am looking for. I try to convert from HTML/JavaScript coding to PHP code.
You may click here http://www.lovemyphoto.com/index.php to see my site.
I am try to undestand from both of you:
<A class=postlink href="viewtopic.php[b]?t=1030"[/b] target=_blank>Sticky: Before Post Read: Frames, JavaScript, and PHP Overview</A> answer the question?
and
<A href="http://www.something.com/index.php[b]?hello=by[/b]" target=_blank>http://www.something.com/index.php?hello=by</A>
What is the viewtopic.php?t=1030, is this the param PHP pass to it the viewtopic.php?
How do I pass a param "image.jpg" to the ShowImg.php below?
http://www.lovemyphoto.com/ShowImg.php?[b]what to write in here?[/b]
Please HELP
You may click here http://www.lovemyphoto.com/index.php to see my site.
I am try to undestand from both of you:
<A class=postlink href="viewtopic.php[b]?t=1030"[/b] target=_blank>Sticky: Before Post Read: Frames, JavaScript, and PHP Overview</A> answer the question?
and
<A href="http://www.something.com/index.php[b]?hello=by[/b]" target=_blank>http://www.something.com/index.php?hello=by</A>
What is the viewtopic.php?t=1030, is this the param PHP pass to it the viewtopic.php?
How do I pass a param "image.jpg" to the ShowImg.php below?
http://www.lovemyphoto.com/ShowImg.php?[b]what to write in here?[/b]
Please HELP
Last edited by PHIEUDZU on Mon Oct 14, 2002 10:55 am, edited 1 time in total.
- AVATAr
- Forum Regular
- Posts: 524
- Joined: Tue Jul 16, 2002 4:19 pm
- Location: Uruguay -- Montevideo
- Contact:
Passing Variables
If you want to pass a veriable to a php script:
http://www.lovemyphoto.com/ShowImg.php?variable=value
for instance:
http://www.lovemyphoto.com/ShowImg.php?image=image.jpg
then in your php page: ShowImg.php, you use the $image variable to display (read the sticky as Volka said) on how to read this kind of variables in posts and gets..
hope it helps
?>
http://www.lovemyphoto.com/ShowImg.php?variable=value
for instance:
http://www.lovemyphoto.com/ShowImg.php?image=image.jpg
then in your php page: ShowImg.php, you use the $image variable to display (read the sticky as Volka said) on how to read this kind of variables in posts and gets..
hope it helps
?>