View Full Version : Simple links in a forum, possible?
Flash Gordon
07-05-2005, 05:07 PM
Hi ya,
I try to put some simple CSS formated text in to a forum, that when clicked will pass the variable to my waiting PHP file. Something like:
<form name="form1" method="get" action="myPHP.php">
<name="one">One</name>
<name="two">Two</name>
<name="three">Three</name>
</form>
Obviously that doesn't work, but hopefully you can see what I am trying to do. I don't want radio buttons, drop boxes, text fields, etc. Just some simple link-style text.
Perhaps even something like:
<a href="myPHP.php" class="a1" name="one" method="get">One</a>
<a href="myPHP.php" class="a1" name="two" method="get">Two</a>
<a href="myPHP.php" class="a1" value="three" method="get">Three</a>
Thanks for the hand.
FG
Flash Gordon
07-05-2005, 05:18 PM
I just viewed the source here at AS[org]
I think this will do it
<a href="myPHP.php?num='one'" class="a1">One</a>
<a href="myPHP.php?num='two'" class="a1">Two</a>
Duh..... :D
catbert303
07-05-2005, 05:30 PM
something like this?
<a href="myPHP.php?variableName=one">one</a>
<a href="myPHP.php?variableName=two">two</a>
<a href="myPHP.php?variableName=three">three</a>
where variableName is the variable being expected by the PHP script - it would have the value one, two or three depending on which link was clicked.
depending on what happens on myPHP.php it might not be a good idea to use links to send data to the page. scripts that perform operations that change data (eg perform an update or delete on a database) should be used via a form - this prevents automated user agents from accidently visiting the page causing the data to be modified.
the following page has a discussion on how google web accelerator started breaking web applications by following links that were being used to do the job of a form
http://www.37signals.com/svn/archives2/google_web_accelerator_hey_not_so_fast_an_alert_fo r_web_app_designers.php
Flash Gordon
07-05-2005, 06:09 PM
Thanks bud!
I got it working now. I'm just sending that info to load a flash movie, so that's why I'm using get, so they can bookmark the page.
Thanks for your time and help!
New Source:
<a href="same_page.php?interview=one" class="a1">One</a>
<a href="same_page.php?interview=two" class="a1">Two</a>
<a href="same_page.php?interview=three" class="a1">Three</a>
<p><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="250" height="60"><param name="movie" value="<?php echo "$interview" ?>.swf">
<param name="quality" value="high">
<embed src="<?php echo "$interview" ?>.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="250" height="60"></embed>
</object></p>
vBulletin® v3.7.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.