Jump to content


Photo

form question


  • Please log in to reply
4 replies to this topic

#1 bagnallc

bagnallc
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts

Posted 26 June 2006 - 12:03 PM

Hi

I have a page which several forms link to.

i want to refer to the page that the user is coming from but as all pages use the same form to get there i am unsure how to do it.

is there a function which will name the page which you have directly came from?

#2 benji87

benji87
  • Members
  • PipPipPip
  • Advanced Member
  • 136 posts
  • LocationPortsmouth, UK

Posted 26 June 2006 - 12:11 PM

i dont really know what you're getting at but i think your need to use sessions. Why dont you post the coding you've got so far then it might be a little clearer

#3 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 26 June 2006 - 12:28 PM

$_SERVER['HTTP_REFERER']
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#4 bagnallc

bagnallc
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts

Posted 26 June 2006 - 12:29 PM

I have a very basic form as below on page which when called displays stats

<form name="countrystats" action="countrystats.php" method="get">
<?php
include("hidden_fields_for_separate_forms.php");
?>
<input type="submit" value="Stats">
</form>

For this example it works fine and produces the stats as per the mysql query in the code below

<?php
require("connectmysql.php");
include("get_set_criteria.php");
$countryqry=mysql_query("SELECT country.country_name as countryname, count(all_details_inc_prev.race_no_id)
FROM country
JOIN tracks ON country.country_id=tracks.country_id
JOIN race_numbers ON tracks.track_id=race_numbers.track_id
JOIN all_details_inc_prev ON race_numbers.race_no_id=all_details_inc_prev.race_no_id
$nh_flat_aw_join
WHERE race_numbers.race_no_id > 0 $nh_flat_aw_where $datesettings $trackid
group by countryname;
");

if(mysql_num_rows($countryqry) > 0) {
echo "<table cellpadding=3 border=1 bgcolor=#66CCCC>";
echo "<tr align=center>";
echo "<th> </th> <th>Qualifiers</th>";
echo "</tr>";
while($row = mysql_fetch_row($countryqry)) {
echo "<tr align=center>";
echo "<td>".$row[0]."</td>";
echo "<td>".$row[1]."</td>";
echo "</tr>";
}
echo "</table>";
}
echo "<br/>";
if(!$countryqry) {
die ('<p> Can\'t use query :</p>' . mysql_error()); }

?>

What i want though is to alter the "countrystats" form and make it communal to many pages so that when called stats are produced for the relevant page. so if i could tell which page the stats form is being clicked i could have many mysql queries in the one statspage ready to produce depending on where the user came from

#5 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 26 June 2006 - 12:32 PM

$_SERVER['HTTP_REFERER']

Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users