Jump to content

jjmusicpro

Members
  • Posts

    290
  • Joined

  • Last visited

    Never

Everything posted by jjmusicpro

  1. How do i pass the id on the end of redirect? echo "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=nf.php\">"; like echo "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=nf.php <?php $groupid_sent = $_GET['groupid']; echo $groupid_sent ?>\">"; ??? dosnt seem to work
  2. i think i see whats going on, i am not passing the id anymore in the url, how do i pass this again after? when i start out i go to www.mysite.com/index.php?groupid=1 then when i run a search function, it sends me back to index.php, so how can i attached or hide that value of groupid?
  3. This is what i have and it seems to work right off the bat when i go to www.mysite.com/index.php?groupid=1 but when i run a search from that page, and it posts back to itself, it wont display it anymore <?php require_once ('connect.php'); require_once ('opendb.php'); $groupid_sent = $_GET['groupid']; $query = "SELECT * FROM metrogroups WHERE groupid='$groupid_sent'"; $result = @mysql_query ($query); $count = mysql_num_rows($result); //number of results while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ $groupname = $row['groupname'] ; echo $groupname; } ?>
  4. I wanted people to go to www.mysite.com/index.php?groupid=1 So when the page is displayed, it should go into my DB and get the valudes from metroareas, and then dispaly some data from the DB. I cant get seem to get it to do that, here is what i got: <?php if($_SERVER['REQUEST_METHOD'] == "POST"){ $groupid = $_GET['groupid']; while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ $site = $row['groupname'] ; } echo $row['groupname'];} ?> Thanks for the help everyone...ima noob!@
  5. For some reason when i just put what i have, and click submit, it just goes back to index.html. It shoul dbe going to thankyou.html
  6. This was just a piece of code in a if/else statment. Cant i include the <form> here some thing </form> inside the echo statment? I only wanted this data to display if no zip codes were found. everything works fine except this
  7. I cant seem to get this working right, it just redirects to itself. I wanted it to go to the thankyoupage. echo "<b>No locations found for your zip.</b><br>Please fill out the form below so we can help your further.<p>"; echo "<fieldset><form method=\"POST\" action=\"http://fp1.formmail.com/cgi-bin/fm192\"> <input type=\"hidden\" name=\"redirect\" value=\"http://www.mysite/thankyou.html\"> First Name:<input type=\"text\" name=\"Customer_First_Name\"><br>Last Name:<input type=\"text\" name=\"Customer_Last_Name\"><br><input type=\"submit\" value=\"Submit your Information\"></form> </fieldset>";
  8. This is what i have now, and i cant seem to get it to go tot he new site. the page flashes, but it wont go anywhere.. <?php if($_SERVER['REQUEST_METHOD'] == "POST"){ require_once ('connect.php'); require_once ('opendb.php'); $zipcode = $_POST['zipcode_entered_search']; $query = "SELECT * FROM zipcodes WHERE zipcode='$zipcode'"; $result = @mysql_query ($query); $count = mysql_num_rows($result); //number of results if($count=="0"){ echo '<b>No locations found for your zip.</b><br>Please fill out the form below so we can help your further.<p>'; }else if($count=="1"){ $site = $row['redirect_url'] ; echo "<META HTTP-EQUIV=Refresh CONTENT=\"4; URL=$site\">"; }else{ echo "Located $count result(s)<br /><br><table width=\"300\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\">"; while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ echo '<tr><td><img src=mm_smaller.gif></td><td><b>'.$row['company_name'] . '</b>'. '<br>' .'<a href="'. $row['redirect_url'] . '"> Visit Website </a>'. ' ' .'<br>' . $row['notes_1'] . '</td><p></tr><p><p>'; }echo '</tr></table>'; } }else{ // nothing } ?>
  9. thats where i need it to go becuase if it matches the zip code, and only brings back 1 result, i need it to redirct to the redirct_url thats in the database with that zip.
  10. how would i put the value of url_redirect that is pulled fromt he DB in the in that?
  11. i cant use header() because this php is in the middel of my code. How do i do a meta refresh?
  12. Ok i am sure someone can figure this out, I've been banging my head trying to figure it out. The user will come to the index page, and type in a zip code. from there it will post to itself, and do either of 3 things. If no results are found display "No results found" If 1 result is found, i wanted it to redirect to that url, i cant seem to get that javascript to work. and if 2 or more results are found, then loop through like i was doing, and give me the results. I cant seem to get this right...it wont redirect when there is 1 result. <?php if($_SERVER['REQUEST_METHOD'] == "POST"){ require_once ('connect.php'); require_once ('opendb.php'); $zipcode = $_POST['zipcode_entered_search']; $query = "SELECT * FROM zipcodes WHERE zipcode='$zipcode'"; $result = @mysql_query ($query); $count = mysql_num_rows($result); //number of results if($count=="0"){ echo "Nothing Found!"; }else if($count=="1"){ echo "<script type='text/javascript'> window.location = 'http://www.google.com/' </script>"; }else{ echo "Located $count result(s)<br />"; while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ echo $row['company_name'] . '<br>' .'<a href="'. $row['redirect_url'] . '"> Visit Website </a>'. ' ' .'<br>' . $row['notes_1'] . '<p>'; } } }else{ // nothing } ?>
  13. Ok i have a excel form that connects to a database and querys it. And brings back the values into the excel form. Is there a way to just connect via the php script? and not use excel. Question 2, I use Excel to run Macros on a emulated termal program that uses Extra program. Is there a way i can run the macro with php, and display the infomation in php? Or is there a way i can, in php, click a button and have it execute the query in excel, and then save the file, and say "done" on the screen?
  14. Hi I was wondering how can i get my results from a query to display the results in a text box for each table column? Right now, I am able to query the DB, and get it to display the data like i want, however, i cant get it to put the values into a text box. I wanted to do this so, they can change any of the values from that record, then press "update" and it updates it. Here is what I have now, but somethign is wrong with my echo for the results. [code]<?php $pasc_id = $_REQUEST['pasc_id'] ?> <?    $request = "SELECT DISTINCT pasc_id,part_number,return_po,date_entered,part_notes FROM dss_returns where pasc_id = '$pasc_id'";    $query = mysql_query($request);    $num = mysql_num_rows($query);    while($data = mysql_fetch_array($query)){  //echo '<td><a href="./Update_Part.php?pasc_id=' . $data['pasc_id'] . '">' .'  ' . $data['pasc_id'] . '</a>'. '</td>'.'<td>'. $data['part_number'] .'</td>'.'<td>'. $data['return_po']. '</td>' .'<td>'. $data['date_entered']. '</td>' . '<td>' .  $data['part_notes'] . '</td></tr>'; echo '<td><a href="./Update_Part.php?pasc_id=' . $data['pasc_id'] . '">' .'  ' . $data['pasc_id'] . '</a>'. '</td>'; //echo '<form action="Update_Part.php" method="post">'; echo '<input type="text" name="partnumber" size="20" maxlenght="20" value=". $data['part_number'] ."/>';   }  ?>[/code]
  15. Hello Everyone i am new to the forums: I wanted to search my table called pasc_id, i wanted to get the last value of this field, and add 1 to it and display it, right now i have the code below, but when i run it, it displays this: "Resource id #4" in the text box, i dont know where its pulling that from. <input type="text" name="pascref" size="20" maxlenght="20" value=" <?php    $query1 = "SELECT max(pasc_id) + 1 FROM dss_returns";    $result1 = @mysql_query ($query1);    echo $result1;  ?>     " />
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.