xcali Posted April 17, 2008 Share Posted April 17, 2008 Hello! I have a quick question i would like to get some help with if possible: For school project we are doing a web page for a modeling agency and one of the sections is "Browsing". User either enters a name and hits search, or enters search criteria and hits search. Now what i would like to do is have a new window pop out with those results - right now the page only 'jumps' to the results page - then i gotta hit back and refresh the page to be able to search again. Here is the code i am using: <?php if ($_POST['searching'] == "yes") { echo '<h1 class="style2">Results</h1><p>'; $find = $_POST['find']; $field = $_POST['field']; if ($find == "") { echo '<h1 class="style2"><p>You forgot to enter a search term</h1>'; exit; } require_once ('../cgi-bin/dbconnect.php'); $find = strtoupper($find); $find = strip_tags($find); $find = trim ($find); $data = mysql_query("SELECT * FROM users WHERE regis_as='M' and upper($field) LIKE'%$find%'"); while($result = mysql_fetch_array( $data )) { echo $result['first_name']; echo " "; echo $result['last_name']; echo " - "; echo $result['username']; echo " - "; echo $result['age']; echo " - "; echo $result['ethnicity']; echo "<br>"; } $anymatches=mysql_num_rows($data); if ($anymatches == 0) { echo "Sorry, but we can not find an entry to match your query<br><br>"; } } ?> later on i'm gonna fix it and make the results display in a nice table with background and buttons and such For now i just need it to open in a new window. Noob question but please advise Link to comment https://forums.phpfreaks.com/topic/101502-display-result-from-php-code-in-new-page-please-help/ Share on other sites More sharing options...
xcali Posted April 17, 2008 Author Share Posted April 17, 2008 dang i thought its gonna be easy just add one line <a href... blablabla> guess not that easy >_< Link to comment https://forums.phpfreaks.com/topic/101502-display-result-from-php-code-in-new-page-please-help/#findComment-519656 Share on other sites More sharing options...
jonsjava Posted April 17, 2008 Share Posted April 17, 2008 I don't know about everybody else, but I don't help people by doing their homework for them. Link to comment https://forums.phpfreaks.com/topic/101502-display-result-from-php-code-in-new-page-please-help/#findComment-519660 Share on other sites More sharing options...
xcali Posted April 17, 2008 Author Share Posted April 17, 2008 its not like i'm asking someone to write out the whole for me or a script just asking if theres an easy way to make the results appear on the new page so far i can do it on the same page which is kind of nice - but it would look better if i had them displayed on a new page but thanks for your answer Link to comment https://forums.phpfreaks.com/topic/101502-display-result-from-php-code-in-new-page-please-help/#findComment-519674 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.