jjmusicpro Posted October 17, 2007 Share Posted October 17, 2007 i am passing a value of : $vsrefdom = $_GET['_vsrefdom']; However, when i am trying to put the value of the pass variable in the output in my echo, however it wontput it in the hyperlink, everything else is fine ANy ideas? while($acc3=mysql_fetch_array($acc2)) { echo '<tr><td colspan=2 valign="middle">' . $acc3['company_name'] . '<br>' .$acc3['notes_1'] . '</b></td></tr><tr><td valign=top><img src=mm_smaller.gif></td><td>' .'<b>Phone:</b>'. ' ' . $acc3['phone_number'] . '<br>'.'<a href="'. $acc3['redirect_url'] . '?_vsrefdom=' . $vsrefdom . '"> Visit Website </a>'. ' ' .'</td></tr>'; }echo '</table>'; Quote Link to comment https://forums.phpfreaks.com/topic/73697-solved-echo-cant-get-1-thing-to-print/ Share on other sites More sharing options...
kernelgpf Posted October 17, 2007 Share Posted October 17, 2007 Try this: $vsrefdom=$_GET['_vsrefdom']; while($acc3=mysql_fetch_array($acc2)) { echo '<tr><td colspan=2 valign="middle">' . $acc3['company_name'] . '<br>' .$acc3['notes_1'] . '</b></td></tr><tr><td valign=top><img src=mm_smaller.gif></td><td>' .'<b>Phone:</b>'. ' ' . $acc3['phone_number'] . '<br>'.'<a href="'. $acc3['redirect_url'] . '?_vsrefdom=' . $vsrefdom . '"> Visit Website </a>'. ' ' .'</td></tr>'; } echo '</table>'; Quote Link to comment https://forums.phpfreaks.com/topic/73697-solved-echo-cant-get-1-thing-to-print/#findComment-371839 Share on other sites More sharing options...
jjmusicpro Posted October 17, 2007 Author Share Posted October 17, 2007 I tried it, however, it dosent put a value for that variable. Quote Link to comment https://forums.phpfreaks.com/topic/73697-solved-echo-cant-get-1-thing-to-print/#findComment-371843 Share on other sites More sharing options...
darkfreaks Posted October 17, 2007 Share Posted October 17, 2007 <?php $vsrefdom=$_GET['_vsrefdom']; while($acc3=mysql_fetch_array($acc2)) { echo '<tr><td colspan=2 valign="middle">' . $acc3['company_name'] . '<br>' .$acc3['notes_1'] . '</b></td></tr><tr><td valign=top><img src=mm_smaller.gif></td><td>' .'<b>Phone:</b>'. ' ' . $acc3['phone_number'] . '<br>'.'<a href="'. $acc3['redirect_url'] . '?_vsrefdom=' . $vsrefdom . '"> Visit Website </a>'. ' ' .'</td></tr>'; } echo '</table>'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/73697-solved-echo-cant-get-1-thing-to-print/#findComment-371846 Share on other sites More sharing options...
kernelgpf Posted October 17, 2007 Share Posted October 17, 2007 Hm.. I think you can't start a variable with an underscore. Try removing the underscore.. $vsrefdom=$_GET['vsrefdom']; while($acc3=mysql_fetch_array($acc2)) { echo '<tr><td colspan=2 valign="middle">' . $acc3['company_name'] . '<br>' .$acc3['notes_1'] . '</b></td></tr><tr><td valign=top><img src=mm_smaller.gif></td><td>' .'<b>Phone:</b>'. ' ' . $acc3['phone_number'] . '<br>'.'<a href="'. $acc3['redirect_url'] . '?vsrefdom=' . $vsrefdom . '"> Visit Website </a>'. ' ' .'</td></tr>'; } echo '</table>'; Quote Link to comment https://forums.phpfreaks.com/topic/73697-solved-echo-cant-get-1-thing-to-print/#findComment-371847 Share on other sites More sharing options...
jjmusicpro Posted October 17, 2007 Author Share Posted October 17, 2007 I think i found the problem, i have a page called process.php that it hits first before going to his page, it dosent seem tobe passing that value. I have 3 things that can happne, if 0 results are found go to nf.php, if 1 is found, go to its url from the db, and pass that value - that works... if anything else, i want it to go to shard.php, and do the code i posted above, and in the URL's put that value. here is my code for process.php $vsrefdom = $_GET['_vsrefdom']; echo "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=$site?_vsrefdom=" . $_GET['_vsrefdom'] . "\">"; }}else{ $vsrefdom = $_GET['_vsrefdom']; echo "<meta http-equiv=\"Refresh\" content=\"0;url=shared.php?_vsrefdom=" . $_GET['$_vsrefdom'] .' &groupid' . $_GET['groupid'] . '&zipcode_entered_search=' . $zipcode ."\">"; } }else{ } ?> Quote Link to comment https://forums.phpfreaks.com/topic/73697-solved-echo-cant-get-1-thing-to-print/#findComment-371853 Share on other sites More sharing options...
jjmusicpro Posted October 17, 2007 Author Share Posted October 17, 2007 Here is my whole code: It works if it just gets 1 result, and goes to the URL, however it wont pass the vsrefdom variable of 0 or 2+ zipcodes are found. <?php if($_SERVER['REQUEST_METHOD'] == "POST"){ $zipcode = $_POST['zipcode_entered_search']; $vsrefdom = $_GET['_vsrefdom']; $query2 = "INSERT INTO zipcodes_searched (zipcode,time_date) VALUES ('$zipcode', NOW())"; $result2 = mysql_query($query2); $query = "SELECT * FROM zipcodes WHERE zipcode='$zipcode' and on_off=1"; $result = @mysql_query ($query); $count = mysql_num_rows($result); if($count=="0"){ // Set VSREFDOM in URL $vsrefdom = $_GET['_vsrefdom']; echo "<meta http-equiv=\"Refresh\" content=\"0;url=nf.php?_vsrefdom=" . $_GET['$_vsrefdom'] .' &groupid='. $_GET['groupid'] . '?zipcode_entered_search=' . $_GET['zipcode_entered_search'] ."\">"; }else if($count=="1"){ while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ $vsrefdom = $_GET['_vsrefdom']; $site = $row['redirect_url'] ; echo "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=$site?_vsrefdom=" . $_GET['_vsrefdom'] . "\">"; }}else{ $vsrefdom = $_GET['_vsrefdom']; echo "<meta http-equiv=\"Refresh\" content=\"0;url=shared.php?_vsrefdom=" . $_GET['$_vsrefdom'] .' &groupid=' . $_GET['groupid'] . '&zipcode_entered_search=' . $zipcode ."\">"; } }else{ } ?> Quote Link to comment https://forums.phpfreaks.com/topic/73697-solved-echo-cant-get-1-thing-to-print/#findComment-371862 Share on other sites More sharing options...
jjmusicpro Posted October 17, 2007 Author Share Posted October 17, 2007 Ah i figured it out I was tryign to get vsrefdom=" . $_GET['$_vsrefdom'] should be vsrefdom=" . $_GET['_vsrefdom'] Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/73697-solved-echo-cant-get-1-thing-to-print/#findComment-371870 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.