Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




How Do I Make The Results Appear On The Same Page?


Presently i am calling a new file to accept my dropdownlist values. Is it possible to make it such that the results will just appear on the same page? Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Make An Array With Query Results? (Postgresql)
Need help making an array with query results:

$value = $_POST['text'];

$pg = pg_connect('dbname=test user=user password=secret');

$query = "SELECT column FROM information";
$result = pg_query($query);

*** how to create array with $results ***

Help In Trying To Make A Web Page Counter
I'm trying to build a counter that will keep trach how many hits I got
and where they came from. In my html pages I have a script of code
that loads in an image. This image is a php file. When this file
executes it adds one to the stack counter,

The problem is that for the referring server, I alawyas get the server
that is hosting the web page that is calling my web page counter. I'm
assuming its because this is the server that calls the php code on my
server.

I have seen other companies do this, how do they do it????

This is what I have so far.

On the client I insert the following code onto my web pages

<img src="http://216.120.252.101/~multist/ws/add.php?
customer=fred&phrase=google&server=tedserve&filename=fred.html"
alt="boston kitchen design" width="267" height="90">

Where
http://216.120.252.101/~multist/ws/add.php is my php script to update
the stat counter

On my stat counter server,

$from=$_SERVER['HTTP_REFERER'];
// $from='ted'
$sql_string="INSERT INTO `tedpott_webstat`.`web_stat` (";
$sql_string=
$sql_string."`customer`,`path_name`,`from_server`,`key_word_phr ase`,`PageID`,`server_name`,`file_name`)";
$sql_string=$sql_string." VALUES (";
$sql_string=$sql_string."'".$customer."','".$path."','".$from."','".
$phrase."','".$pg."','".$server."','".$filename."'";
$sql_string=$sql_string.")";

print("<br>");
print("<br>");
print("second string b<br>");
print($sql_string);
print("<br>");
if (!$results=mysql_query($sql_string,$dblink))
die("could not add new record");
print("updateds database ok");


// close databse connection
mysql_close($dblink);.

How Can You Make A Page Find Its Own Url?
How can you make a page find its own url? anyone know? i want the page to know its url... like this post new page would know its url is http://forums.devshed.com/newthread...d&forumid=5....

Make A New Page In A Module?
I would like to hake a new page in a module.

Often times at the bottom of a module or page you will see an option to go to next the next page, or you will see a row of number which will link you to the next page. This is what I would like to do. The main issue is that I would like it to keep the same style of the block that is in the first page, on the second page and etc.

I'm not great at php so I downloaded an module called Module_maker. It's easy to use and an happy with the out come so far. The Module Maker has an html.text in it which I add html code to and it will show the code on the block inside the module. So.. I would like to have a second page and more which would be navigated to with a link somewhere on the page. keeping the same style. What would be very cool is if the only thing that changed when clicking "next page" would be the block its self.. That maybe going to far. Code:

How Do I Make My Page Stop Caching?
I have a PHP page that holds info that comes from a MySQL database. I have another page that modifies the info to the users liking, and then sends them back to th first ppage with all the info. Problem is it shows up the same as before. For example, if I delete one of the entries, it's still there when I get sent back.

How To Make Page Variable In Height
I want to programatically make my page of varying height based on the
content. if you go to trinadoula.com you will see what i am talking
about. you'll see the mid section of the page is a bar that could be
stacked on top of itself over and over in a loop to make a variable
height page. how can i use php to analyze how tall the content is
(i.e. the text, or images) and then loop a image bar on top of itself
to make the page different heights?

How To Make A Proper Logout Page?
Make a logout page such as "logout.php". This page will be used anytime when the uses wishes to logout. Therefore for all my other pages, I just send the user to my logout.php when he/she clicks to logout. Most of it is easy but I'm having problems with a logout.php that can deal with frames. This is my problem:

in my bottomFrame, I have a click that sends the topFrame to logout.php. But you can imagine what will happen right? It will make the topFrame logout and bottomFRAME will stay and do nothing. How can I kill the bottomFrame when the topFRAMe goes to logout.php?
There must be a code that I can put in the logout.php that will kill any frames if they exist.

Make It Link To Another Html Page
How to retrive feild from table and make it clickable and link to another html page.

How To Make Image Of Web Page (thumbshots)
How to make image of web page, like this:

How To Make Tabbed (overlayed) Zones Of A Page.
I'd like to use PHP and JavaScript to make a zone (say the lower right quarter) of the page to display one bit of content when the user clicks a tab button above the zone, and a different bit of content when the user clicks a new tab, etc., all without updating the whole page.

I know this can be done with JavaScript by swapping images, but I'd like the content to be HTML with the option of embedded links - rather than pure graphics content.

For those of you who use IE, go to www.msdn.microsoft.com to see the tabbed content zone and see it in action. However they did it, it isn't functional when viewing it with Netscape.

Make Sure User Is Referred By Specific Page.
I know this is possible because I have seen it in a few scripts before, but I forgot exactly how the language was put.

I have a link on a page inside a password protected folder, lets call it domain.com/protected/hide.php.

When the user clicks on the hyperlink, they will be redirected to domain.com/folder/page.php

I want to write somewhere on page.php to be sure the visitor came from hide.php, otherwise display an error message. How can I do this?

Need To Make A PHP Script Forward To An Html Page When Processed!
When a php script is processed, how can I then get the script to automatically forward to a confirmation page? The script in question is a mail script, and I need to get this to forward to an html page to basically say, 'mail is sent'.

Complete Newby Who Is Keen To Make A Search Page
I am keen to make a search page on a website, but I have absolutely zero
experience with PHP. I am going to hire an expert, but I thought that it
may pay to try it a bit first myself (I do want to learn how to do it).

What I have is a search page (HTML) and an access database. Now, can
someone give me some clues or links on where to start.

I prefer not to install the whole PHP thing on my own computer, but just to
try it straight on the server (if this is possible).

Having Different Results On Same Page
I have a database that I would like to use to display the contents in different lists on the same page. In other words, I would like a list of the latest 15 entries in the database to appear in list...then I would like the next 15 to appear on the same page but in a different list structure, etc. I have this so far, but it only displays the latest 15...I am stuck on how to get another list generated from the same query: Code:

Use Arrays To Page Through Results?
I've got a search facility that interrogates an SQL database then shows the results 30 at a time. Currently, when you go to the next page of results it has to run the query all over again, because there is no way of handing the resultset to the PHP file. So I wondered if there was another way of doing it.

I'm tempted to use mysql_fetch_array and create a multi-dimensional array full of result rows, then hand that around, but so far cannot find out how to hand a PHP array as a variable to a PHP page.

IS this possible, or am I barking up the wrong tree? Or is there a better way of doing this?

PING Results On PHP Web Page!
Can someone show me sample code on how can I write a script that shows ping results on a web page.

Multi-page Results....
I'm working on an engine to search a MySQL database of a bunch of forum messages. The PHP code retrieves the results from the database, then stores them into an multi-dimensional array for processing.

Once stored, the code parses each result and assigns it a relevancy score, and once all of the results are scored, it then sorts all of the results according to relevance. The end product off all this is an array that holds all of the retrieved messages relevant to the search, holding such information as title, author, date, msgID, blah blah blah. now that i've kinda explained what's going on, i'll get into the problem i've bumped into.

Being that there's roughly 16,000 messages in the database (not to mention the 800,000 lines of message text) that could possibly be the results from a query, displaying it all on one page is most definately out of the question (it still takes a few seconds to load on my cable line with only a few hops to the T3'd server. I'd hate to see what a 33.6 or 56k user would be waiting for).

The real problem all comes down to: how am I going to pass the results from one page to the next? an array of a few thousand messages is a *little* large for an http post action, and storing the results in a table in the mysql database posses a few problems as well (namely, how long to keep the table around after the user has executed the search. temporary tables are out of the question, as they die as soon as the mysql connection is closed, but a persistent mysql connection would create exactly the opposite problem: ei, temp. tables never die).

10 Results Per Page But From Different Categories
I have a script that shows a list from a different category depending on what is in the URL. I've got it to limit the results to the 1st ten results and keep the chosen category in the link(?category=differentcategory) but when next page is clicked it repeats the same ten results. Code:

SQL Query - Results From Another PHP Page ?
Can I store this PHP code in another page, then refernece it on
multiple pages using Require or Include ???

//results from sql query
for ($i=0; $i<$number; $i++) {
$ID = mysql_result($result,$i,"ID");
$CompanyName = mysql_result($result,$i,"1");
$ContactName = mysql_result($result,$i,"2");
$Phone = mysql_result($result,$i,"3");
$HomePhone = mysql_result($result,$i,"4");
$MobilePhone = mysql_result($result,$i,"5");
$AltPhone = mysql_result($result,$i,"6");
$SecondContact = mysql_result($result,$i,"7");
$SecondPhone = mysql_result($result,$i,"8");
$ThirdContact = mysql_result($result,$i,"9");
$ThirdPhone = mysql_result($result,$i,"10");
$Notes = mysql_result($result,$i,"11")

Getting Other Webpage Results In To Php Page
I Have a page which will take authentication from a diffrent page from
a difrent website.

My program needs to call a page like this from php page lets say:
http://www.abc.com?handshake.jsp?us...htoken=94399843

my php page is at www.xyz.com
based on this url's response i need to print the result on my php page?

I tried this..

$url="http://120.126.79.21:6080/AutoPrintWeb/apvalidator.jsp?tempid=$tempid&authtoken=$authtoken&ipaddress=$rmtadd";
$fp = fopen($url, 'r');
$response1=stream_get_meta_data($fp);
print_r($response1);

The reukt is like this:

Array ( [wrapper_data] => Array ( [0] => HTTP/1.1 200 OK [1] => Server:
Apache-Coyote/1.1 [2] => Set-Cookie:
JSESSIONID=B55CA82D1790D6C0A9E20ED1CEDBB1B9; Path=/AutoPrintWeb [3] =>
Content-Type: text/html;charset=UTF-8 [4] => Content-Length: 382 [5] =>
Date: Fri, 10 Mar 2006 10:22:41 GMT [6] => Connection: close )
[wrapper_type] => http [stream_type] => tcp_socket [mode] => r+
[unread_bytes] => 382 [seekable] => [uri] =>
http://193.186.79.21:6080/AutoPrint...dress=127.0.0.1
[timed_out] => [blocked] => 1 [eof] => )

I need only sucesss or fail..

Return Results On One Page
i have a search field on a .php page. i want to return the results on the same page i.e i dont want the action to point to test2.php but test.php which is were my search filed is sitting at the moment. how do i do this? 

i got this on my first page:

<form method="post" action="test2.php">
Name: <input type="text" size="10" maxlength="40" name="name">

<input type="submit" value="Send">
</form>

and this on the second:

<?php
$name = $_POST['name'];
if ($name=="Friday")
  echo "Have a nice weekend!";
elseif ($name=="Saturday")
  echo "Tomorrow is Sunday!";
else
  echo "Please enter Friday or Saturday";
?>

Limit Results To 20 Per Page.
I have a Database and script where it SELECT * FROM my database and lists the info on my website. I want to be able to limit the quary to only 20 per page. Here is an example of what i am talking about on this page http://sacvalleyhomes.com/Sacvalley/property_inquiry.php

Everything listed under Property Inquiry is genarated be my database. As it is now i have 5 diffrent tables for 5 diffrent pages. This is way to much work to keep updated.

What i want to do is put all 5 tables in to 1 table and have my php script only show the first 20 listing then generate the page numbers on the bottom or some way to view next 20 results and so on. Code:

Why Does My Page Always Show JUST First Set Of Results?
Whenever I execute a query I limit it to lets say 2 rows per page. The problem is my code will only say there is 1 page of results when there should be more! What am I doing wrong? Code:

Results Only X Number Per Page...
am doing a real state site and when searching it shows all the results from the database in one single webpage, can you help me with one easy way to show only 10 results per page?

I've seen some complicated sites with previous and next arrows, i only need to show 10 results then a link to show next 10 and that's it.

Limited Results Per Page
i have a download section for my site, with about 20 downloads, and i was wondering if their was a script so that it would only show 5, and clicking 'next' button would show the next 5 etc.

PHP / Microsoft SQL V7/2000 - Page Results
Anyone know a simple way to page results of a SQL Select using Microsoft SQL ? I don't believe they have anything as handy as MySQL LIMIT.

Search Form And Results Page
I have a table called "lista" into my mysql database.This table has 5 text columns : "TRANSLATEDTITLE" "ORIGINALTITLE" "ACTORS" "DIRECTOR" "YEAR" , and 1 image column called "COVER".

I want to create a page with a form to search entries into this table (ex. with Title, Actors, Director, Year), and anotger php page with the search results shown inside, everyone with a link that opens a pop window (ex. 400X320). Code:

Displaying X Number Of Results Per Page
What I need to do is this. I query a MySQL database and, for example, 400 results are returned. I can get it to display the number of results, but I would like to set a value to display, say 20, results per page and generate numbered links with and offset to browse through and next/previous buttons -not unlike this page. Can anyone point me in the direction of a good article or if you have it, post some code here?

Newbie Question: Results By Page
How do I make results that I select from my database on different pages
based on length?

For instance, say I have over 50 records with more being added and I want it
to display 10 records per page. How do I get that info to display only 10 at
a time instead everything all in one page?

Fetching Results Across Page Loads
I would like to find a way to execute a query against an MS SQL server
and return a small number of rows each page load. However, I cannot
read all the results in during the first page load due to size
contraints.

Here are the details. A user submits a request. I construct a SQL query
and execute on the MS SQL server. The query results in a million rows.
The initial page load shows the first 100 rows. Each successive page
load shows the next 100 rows. Because our web server has limited disk
space, I do not want to return the entire result set now, but only 100
rows at a time. Also, for performance reasons, I do not want to rerun
the query each page load.

So, I need a "persistent result" set that can be fetched from across
page loads. I have tried to store the result set in a session variable
using serialize and unserialize, but to no avail. It seems that across
page loads the result set loses its way, even with a persistent
database connection.

Return Search Results On Same Page
I'm struggling with this much longer than I think I need to,

How do I make the results of a search display on the same page as the
search, sort of beneath the 'submit' button? Thanks for helping out.


Page Navigation From Search Results
I have created a search form that searchs for results from my database matching the criteria to what ever the user inputs. I have done this using 2 php pages the first page points to the second, where the data is sanitised and cleaned accordingly. The results are displayed on the 2nd page. Code:

How Do I Return 10 Results Per Page Using SELECT Statement?
I'm wasn't sure whether to post this under the PHP or under the MySQL section of the forums. Since most people (I'm assuming) who write PHP script, also use MySQL, I thought I'd stick with PHP. I'm rather new to both PHP and MySQL and I'd be very grateful to anyone who can help me solve a problem I'm having at the moment. First, I'll give you an introduction to my little project...

I'm developing a database in MySQL that is used to store the song titles of all the MP3s I have on my PC. I've written a basic search feature that works well. The user has 2 options: Either he can type a special "!ALL" "parameter", that I made up, to return all the songs in the database or the user may enter a few characters in the textbox and select "song title" or "artist" etc. from a dropdown to search for a specific song title or artist etc.. Hope you are following so far? Say for example the user presses submit after typing "!ALL" to return all the song titles - there could be hundreds of results. What I want to do now is display 10 results on a page, then on the next page another 10, etc. (like a real search engine!). I've tried doing it with the LIMIT statement, but like I said I'm new to this and discovered that that is not the right way of going about it. My question is this: how would I go about returning 10 matches per page? Do I use hidden form fields? What would the SELECT statement look like? What would the PHP scripting look like to setup the "back" and "forward" navigation between the result for the search?

Displaying X Number Of MySQL Results Per Page
I'm writing a search on a MySQL DB, and everything so far has just gone swimmingly. I've got a "results per page" drop down box in my form, with a few different values.

At the moment, I'm just using:

while($myrow = mysql_fetch_array($result)

to output results to screen.

I'm not too sure how to go about it, but I did have two thoughts:

1) Suck the results into a multi-dimensional array, and pass the array to a display results script (not sure if you can pass arrays to other scripts???

2) Display x number of results, then have the "Next" (or 2, 3... ) links call the search again, but displaying results x+1 - x+x.

1 sounds like too much trouble, and 2 sounds inefficient. Not too sure how else to go about it. Any info / thoughts you guys have would be much appreciated.

On a side note, how do you look at a specific row in the result?

Limiting Results, And Display Page Numbers
How do I make it so only 50 items display per page. And if there's more than 50, it displays a link "page 2", "page 3" and so on? I know how to limit results with MySQL but how do I generate pages for the next 50 within the PHP code?

Link To Form Results Page Dynamically
I have a dropdown box that pulls information from a database. What I want to achieve is that when a caller selects an option, the option determines that page that comes up.

I tried setting the form action to the name of the option, but this down not bring up anything; actually the resulting page is .php. I also tried moving the form action statement after ther selection, but that does not work either - the Submit button does not work. PHP Code:

Search Results Showing An Include Page
I have a page index.php which includes different templates based on a passed URL variable through the include() function. My problem is that I have the files saved as temp.inc.php files. Search engines are returning the include page as a result and then the user is directed to a new window with just the include page displayed. Any ideas on how to get around this?

How To Pass Mysql Search Results From One Page To Another
I am creating a website that uses PHP to query a MySql database. upon supplying the PHP script with a given search string and search term, a list of scientific documents with attributes such as author, date, url and revision are returned. Each document also has a unique id number within the database. What I would like to do is create a system whereby user of the site can leave reviews for each particular document, much like the product review system employed at jungle.com. I have got to the stage where the php script outputs a list of results each separated by a horizontal rule and what i would like is to be able to place a button on each record marked submit review, which would then take the user to a form where he or she could leave a review which would placed into a reviews table in the database.

However my problem is that i do not understand how to pass the paper id automatically to the form such that the user does not have the inconvenience of having to type into the form. Does anyone have any ideas on how I could solve this problem?

Populating Form From Database, Then Passing Results To Next Page
I have a multiple select input in a form that's being populated by a row
from my database as such:
<input type="checkbox" name="subm[]" value="$row[ID]">

That part is working fine as I can check the displayed page using View
Source and see that the value is the correct row number from the
database. It is then being submitted on a form by $_POST method to
another page where I want to evaluate the checkboxes and display the
contents of the entire row that corresponds to each value="$row[ID]"
that have been checked. But I can't seem to get it to work. I'm having a
problem passing the selected value. Can someone point me in the right
direction?

$query = ("SELECT * FROM `table`");
$result = mysql_query($query);

print "<p>Data for Selections:";
print "<table border=2><tr><th>You chose:";

foreach ($_POST['subm'] as $value) {
print "<tr><td>";
print "$row[ID];
";
print mysql_field_name($result, 1) . ": " . $row[name]."<br>";
print mysql_field_name($result, 2) . ": " . $row[address]."<br>";
print mysql_field_name($result, 3) . ": " . $row[city]."<br>";
print "</td></tr>";
print "</table>
";
}

if (!isset($_POST['subm'])){
print "<p>No matching entry ";
}

mysql_close();

No Libphp4.so File Created In Make Intstall Or Make.
I have done a make, and a make install on the 4.3.6 version, using
/usr/local/etc/php as the directory I make from. However, no matter what
I do, I do not see a php4lib.so that has been created. The documentation
I recieved (an IBM source) says that the following has to be added to the
httpd.conf file :

LoadModule php4_modulelib/apache/libphp4.so
..
..
..
AddModule mod_php4.c

here is the output from my make install :

[root@mail php]# make install
Installing PHP SAPI module: cgi
Installing PHP CGI into: /usr/local/bin/
Installing PEAR environment: /usr/local/lib/php/
[PEAR] Archive_Tar - already installed: 1.1
[PEAR] Console_Getopt - already installed: 1.2
[PEAR] PEAR - already installed: 1.3.1
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
[PEAR] DB - already installed: 1.6.2
[PEAR] HTTP - already installed: 1.2.2
[PEAR] Mail - already installed: 1.1.3
[PEAR] Net_SMTP - already installed: 1.2.3
[PEAR] Net_Socket - already installed: 1.0.1
[PEAR] XML_Parser - already installed: 1.0.1
[PEAR] XML_RPC - already installed: 1.1.0
Installing build environment: /usr/local/lib/php/build/
Installing header files: /usr/local/include/php/
Installing helper programs: /usr/local/bin/
program: phpize
program: php-config
program: phpextdist

Search Brings Back Different Results Or Sometimes No Results
The problem Iv got is that when searching the site - it brings back different results or sometimes no results. For example: "i026", "i 026" and "026" do not bring back results for "I-026" which is the correct model number. Any ideas on how to make it search more variations or of a "Did you mean... I-026" script?

Search Results ($num_rows) Does Not Match $search Results (PHP,MySQL)?
For example, when I do a database search for a term I get 2 results but the $num_rows says there are 3 results.

I suspect it's because there are similar keywords within different search fields of the SQL statement. But I am stumped as to how I can change this. Any Suggestions? the code:

Possible To Make Thumbnails?
Hello all! Do you think it's possible to use a kind of php code or a special package or something to make thumbnails from a large image with php?

Make Table Appear On Top
i made a php with just a table and included all the material with php include http://www.hbksite.com/index2.php but here is the problem when i got to it the menu appears in the middle is there any way to make it be always on top please help here is the code:

Make A Graphic
i have to make a graphic with data coming from a mysql database... i'll use php ...it is for a web site ...it is a linegraph ...does someone know how to do that ?

Need To Make An IP Ban Mask
I need to create a small PHP script for my site that allows me to ban certain IPs. Ive created a script that reads a file, and if the IPs in the file match the user IP, they cant access the site.

However, i want to take this one step further, and allow masks to be specified. What i mean by this is i'd like to be able to put in the banfile something like: 111.111.111.*, and it would then ban anything in the range 111.111.111.0 - 111.111.111.255.

Can PHP With AJAX Make Changes To The Url?
I am currently doing a forum script project (using PHP/MySQL, and hopefully, some AJAX).

One concern is that if AJAX can handle $_GET and output its content to the url?

Say if my forum index page is called index.php, then if I click on a thread, it displays the thread AND changes the url to index.php?postid=1

Is this possible?

FYI, I plan to use Xajax library.

How To Make New Variable
how do I change this to the new variable so I don't get the error message, I want to have the settings like this for security reason:

error_reporting = E_ALL
register_globals = off

so I get a clean code.

if(!$aa)$aa=0;
$result = mysql_query("SELECT * FROM forum where ny =&#391;' order by nr desc LIMIT $aa,10") or die (mysql_error());
<form name="forum" method="POST" action="<?=$PHP_self?>?aa=0"><div align="center">
$i ++;

this is the lines I get the error.

How Do You Make Something Alternate...
I'm using the while() function to get posts out of a database, they are each in their own table, and I want the tables to alternate from $color1 to $color2 like this forum does when reading a thread on all the posts, how can I do this?


Copyright © 2005-08 www.BigResource.com, All rights reserved