bagnallc Posted June 26, 2006 Share Posted June 26, 2006 HiI 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? Link to comment https://forums.phpfreaks.com/topic/12932-form-question/ Share on other sites More sharing options...
benji87 Posted June 26, 2006 Share Posted June 26, 2006 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 Link to comment https://forums.phpfreaks.com/topic/12932-form-question/#findComment-49641 Share on other sites More sharing options...
.josh Posted June 26, 2006 Share Posted June 26, 2006 $_SERVER['HTTP_REFERER'] Link to comment https://forums.phpfreaks.com/topic/12932-form-question/#findComment-49645 Share on other sites More sharing options...
bagnallc Posted June 26, 2006 Author Share Posted June 26, 2006 I have a very basic form as below on page which when called displays stats<form name="countrystats" action="countrystats.php" method="get"><?phpinclude("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<?phprequire("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 countryJOIN tracks ON country.country_id=tracks.country_idJOIN race_numbers ON tracks.track_id=race_numbers.track_idJOIN all_details_inc_prev ON race_numbers.race_no_id=all_details_inc_prev.race_no_id $nh_flat_aw_joinWHERE race_numbers.race_no_id > 0 $nh_flat_aw_where $datesettings $trackidgroup 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 Link to comment https://forums.phpfreaks.com/topic/12932-form-question/#findComment-49646 Share on other sites More sharing options...
.josh Posted June 26, 2006 Share Posted June 26, 2006 $_SERVER['HTTP_REFERER'] Link to comment https://forums.phpfreaks.com/topic/12932-form-question/#findComment-49648 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.