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




Can Header() Do A Div Reload Without A Page Reload (ie Ajax-type)?


I have a display page (displaypage.php) divided into two panes - one for content and one for feedback, referred to in the CSS as contentDiv and feedbackDiv respectively.

When I click on a word in the content pane, I do a PHP/PostgreSQL search for similar words, and the results appear in the feedback pane without a page reload. For this, I am using a very basic Ajax setup Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Page Reload
I have succesfully created a login page for my site. I have used the PHP_SELF
so that once the user has succesfully logged on the page reloads. Everything
works fine the first time somebody tries to log in but when they revisit, the
log on page is bypassed and it goes straight to the information page. I have a
sneaky suspicion that this is due to the fact that the page is then in their
history of recently visited sites. How can I use PHP to refresh the page
automatically everytime it is requested?

Combo Box Value On Page Reload
I am new to php and mySQL so this is probably something very basic that I'm
missing. Basically, on the page I have 2 combo boxes but 1 of them is not
getting the value passed when the page is reloaded so the database can be
updated. I am echoing the field names passed and the field "theDriver" is
there but it's empty. I've include the code parts where I believe the
problem should be but I'm stumped and I've been trying to solve this for 2
days without success. Would someone mind examing the following code and
tell me what I've done wrong?

Following code constructs the combo box on the page from a MySQL table:
<?PHP
$table = "tblEmployees";
$Link = mysql_connect ($host, $user, $password);

$Query = "select concat(empID,' ',empFirstName,'
',empLastName)
as full_name from $table WHERE empTitle =
'Driver'";
$results = mysql_db_query($database, $Query, $Link);
?>

&nbsp;&nbsp;&nbsp;&nbsp;<b>Driver:</b>
<select name = "theDriver" size="1">
<Option Value=" ">Select One:</option>

<?PHP
for($u=0;$u<mysql_num_rows($results); $u++)
{
$driver=mysql_result($results,$u,'full_name');
?>
<option value="<?PHP echo($ID); ?>"><?
echo($driver); ?></option>
<?PHP
}
?> //end php

</select>

When Page is reloaded the following code is run but the combo box titled
"theDriver" is empty

foreach($_POST as $field => $value)
{
echo $field; //field names from form
echo "; ";
if ($field == "theDriver")
{
echo " - here's the driver for ya: ";
$$field = strip_tags(trim($value));
echo $$field;
$pos = strpos($driver, ";");
echo "<br> the ; is in pos $pos <br>";.......

Page Cache/reload
I have created a facility for users of a site to enter details of property (e.g. location, size etc.). This allows them to upload a picture. Users can also update a picture, adding a new picture to replace an existing one.

My problem is that if a user changes/updates the picture and then views the details the old details are displayed unless the user manually clicks refresh.

I know that this is because IE is storing the page in cache. I have tried the Meta Tags with "no cache" and "expires" but they don't work. I have also tried to get the page to refresh itself on loading, but it either doesn't work at all or keeps refreshing over and over again. Ideally i would like the page to just refresh once and then stop refreshing but there doesn't appear to be any way of doing this.

Page Reload With An <iframe>
Let me to explain the structure....

filename : api.php

Having an <iframe src="remotehost/index.php"> </iframe>

i have to reload current page api.php after some execution of remotehost/index.php ... I've tried header(); but got formal header error. can we reload current browser url from an iframed code?

Session Var Is Setting ONLY AFTER I Reload Page, Form Var Displays First Page Load
Page1 has a form that calls Page2. The beginning of Page2:
<? php session_start();
$s=$_POST['sSelected'];
session_register("s"); ?>

in the middle of Page2 I have a form varaible:
<?php echo $_POST['stateSelected']; ?>
<?php echo $_SESSION['s']; ?>

The form var displays the first time the page loads. The session var
displays only after reloading the page2.

Reload The Same Page With A Form After Submit?
I have a page with a form, and the code to process the form answers, I want the same page/form to just reload when the user presses submit. The only function I have found is that location command. PHP Code:

How Do I Force A FRESH RELOAD Of A Page
I've built a few php scripts, but since its reloading the same page I can't get it to refresh the page. I've implemented some expire meta tag...but is there anyway I can try and force it to refresh?

Session ID Changed Everytime Go To New Page Or Reload.
I'm new member of this group.

I had added new virtual host at my intranet server. The new virtual
host configuration on httpd.conf is similar with the old one.
At the new virtual host, the session id seems changed every
interaction to server (new page or reload).
The old one is fine, the session id keeps at the same string.
Both are at the same server.
I use Apache 2.2.3 (Win32) with PHP 5.2.0.

Tested using code below:
session_start();
echo session_id();

PHP Configuration :
session.save_handler = files
;session.save_path = "/tmp"
session.use_cookies = 1
;session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.bug_compat_42 = 0
session.bug_compat_warn = 1
session.referer_check =
session.entropy_length = 0
session.entropy_file =
;session.entropy_length = 16
;session.entropy_file = /dev/urandom
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5

Stop File Reload When Page Is Refreshed
I have a section of PHP code at the beginning of the page that loads a file which the user has specified in the form, on the same page. The problem is that everytime the page is refresh with the refresh button, the file loads. I want the file loading to happen only if the user has pressed the submit buttom.

Reload A Page After Execution Of A Mysql-query In Php
I am aware that this question might involve Javascript and MySQL. So
far I haven´t found a suitable solution in JavaScript ng´s - maybe
becauese php-programmers are more likely to come across the following
problem:

A script on my page relays a quite complicated query to a MySQL-server
with mysql_query(...); The query works fine but takes very long - I
usually have to wait for approx. 30 seconds before the query is
returned from MySQL and the results displayed by php on a webpage.

I´d rather have the results of the query written into a nice textfile
and display a text like "Results are being retrieved" in stead of the
actual results and have the page reloaded a f t e r the textfile has
been updated. The newly loaded page then would obviously first check
whether this very textfile has been updated or not and read out its
contents in case it is has been updated less then let´s say two
minutes ago.

I hope I can make myself understood...:)

My question is: what actual code (I am almost sure it must be
JavaScript and not PHP) does PHP have to generate in order for the page
to reload after the results are retrieved and stored in the textfile?

Reload Outside Page OnClick Of Submit Button
I'm using frames to create a "bookmark-like" page. You can enter a URL and it gets added to my database. I have two frames (leftFrame - to display bookmarks entered and mainFrame to show web page). I want the leftFrame to automatically refresh when the user enters a bookmark. As of now you must physically refresh the page to see the results. Here's my code:

Preventing Multiple Data Insertion On Page Reload
I am developing a PHP-mysql database. It is noted that when the
browser window is refreshed the data is inserted again in the
database. unfortunately there is no unique keys that I can use to
verify the existance of the data, so as to prevent the multiple
insertion. Is there any other way to prevent it otherthan introducing
another field for this purpose and verifying its existance?

Saving Selection In Drop-down Lists In PHP After Page Reload?
I can't find an answer to my quesiton anywhere.

Given a drop-down list with USA states and other text fields I pass
this information for further processing via PHP. If any of the required

fields is empty, the PHP script would return an error and reload the
form page asking to fill out those fields. All entered information is
saved... except for the drop-down list selection. I tried to write a
Javascript function which is echoed by PHP, but interpolation of PHP
variables in the Javascript section gives a syntax error message in
Javascript.

The PHP script returns, e.g., an "AL" string for Alabama. Of course, I
don't want to write PHP code for each option to make it selected.

$_SESSION Problem - Page Reload Creates New Session ID
I am having trouble using the session vars in
PHP 4.3.9
OS: Win XP Prof
Web Server IIS (is local and there are no links to other servers from
the web pages I work on)
Browser: IE 6.0

The problem I am having is that each time I reload the same PHP page, I get
a different
Session ID (and thus all session vars are lost from one page to another).

let's say in firstpage.php I set
$_SESSION["firstvar"] = "someval";
$_SESSION["secvar"] = "otherval";

and in secpage.php I try to retrieve $_SESSION["firstvar"] , it gives me
"Undefined Index error"
I did not know what is happening and when printing out the session id (echo
SID;) I found out
that the ID is changing every time page is reloaded or when moving to
another page.

The problem is that I don't know what might reset the session since I use
"session_auto_start"
and have not played with session_start, session_destroy or anything else.

Force Reload Of Page When User Press "Back" Button
Is there a way to force a page to reload if a user har pressed the "Back" button in the browser.

What Is The Best Way To Use PHP To "reload" Web Page?
I am trying to code my "notfound.html" page when people click on the
link that will send them back to home page, that the "entire" browser is
"refreshed".

Reason for doing this. I have frames on the home page. When user click
on the link on "notfound.html", the home page appears within the home
page frame. So I see 2 home pages. I have to physically click on the
"reload" button on the browser to the the appearance that I want. But I
know that "common" user will not think of that, and will determin that
the home page is buggy...

Reload.
I have the following problem. Using php I have composed a file which
add to an html file text typed into text-field. Problem is that I can
see new conntent of html file only after pressing "reload" button of
browser. My question is whether I can add some fragment to the html
file to force it to reload atomatically?

Refresh Or Reload
Hi!

I need to make a webpage refresh using code, I don't want that the user uses the refresh button (you know! always forget to do it)

So, how can I do to do that in PHP?

Php Form Reload
I want to make a search form which contains make, model and year of make as search condition. All these information should be taken from the database. After selecting the make the model selection menu should take the value which is coming under the same make. Is it possible to reload the same page and take the value from the database. or it is possible to add a select table values where the select query contains a criteria which is taken from the same just before that.

Reload Isn't Reloading
Still getting the same issue i submitted a couple of days ago. I can use
PuTTY to edit files in-place, on production server, and when I refresh
the page the changes won't have any effect.

I have made sure the templates_c (smarty) is 777; httpd runs as "nobody"
so i made chgrp'd the whole htdocs directory to "nobody". i even
reinstalled Apache/MySQL/PHP. where should I start looking?

How Do I Reload The Php.ini File?
I can't figure out how to make PHP reload it's php.ini -file. I changed the default dirctory for storing sessions but can't make PHP re-read the file and apply my changes.
I'm using PHP 4.0.4pl1, Apache 1.3.14 and MySQL 3.23.34 on Windows 2000.

Reload Problem
I have a page that displays information from a database. I have a link that pops up a window with a form in it. The form adds content to the database. Here is my dilemma, I want the main page (not the pop up) to reload after the form has been submitted in the pop up window, so that the new content added to the database will now show up on the main page.

Reload Php-image
I've, inside an html page, an image which is created through a php file
:

<img src="<?php echo 'captcha.php' ?>">

file captcha.php, sends
header("Content-type: image/png");

All works fine, but I need to reload the image (a new captcha code
should be generated) without reloading the enitre page. Are there any
solution? I'll post a similar question in javascript forums

I'm working on a "post comment" form using ajax.

Will This SQL Dump Reload
I created and loaded a database.
The first three fields are id, first_name and last_name
I used addslashes on the first and last names.
Here is a portion of the SQL dump that I took for backup. I have
concerns about record 47 because of the single quote in the name.

Will this dump reload ?

47, 'Sean', 'O''Kelly', NULL, NULL,

It appears that SQL is using a double quote rather than escaping
the single quote.

As usual, after reassuring me, a pointer to a reference would be
adequate.

Force Reload
Is there any way I can force my php scripts to reload everytime they are used ?

Reload Vs. Refresh
Is there a difference between reload and refresh? How is this coded in the header?

Redirection - Reload
I wonder if it posible to reload a web page using php ? ? ?

No javascript or something similar.

Reload Form Data
I am developing a web site using php. I have a form for login in page1, which has two input box and a submit button. When I click the submit button in page1, it runs page2. When I click BACK button(now in page1), and FORWARD button (supposed to be in page2). Both IE and Netscape give me a message like the following (note: the browser cache is not turned off either by php header() or by browser setting):
*********************************************
This document resulted from a POST operation and has expired from the cache. If you wish you can repost the form data to recreate the document by pressing the
reload button.
*********************************************

When I press the RELOAD button, page2 is load correctly. Now, how can let the browser automatically do the reload without showing me the above message?

Reload Text Only, Not Images
I have a webpage wich I need to reload every 3-5 seconds.
When I use the header("Refresh: 3"); for example, the images are sort of blinking.
Is there a way to avoid this?

Reload Image Directly
I am uploading a new image to my database. The upload works ok and the new image is stored ok on server. The problem is can I force a reload on cache to display the new image. If I reload the page it works fine but if i dont then the old image is displayed.is there a way to force a reload of image.

Dyanmic Images Reload
I have a php script that dynamically creates images, reusing image files on
the server to save space and clutter.

The problem is described in the steps below:

1. User clicks on a button.
2. Same page loads, but the php script creates a new image in an old file.
3. It displays the image file, but the old image shows, even though the file
contains the new image.

My options are:

1. Use javascript to force a reload when the user clicks the button (not
desirable, because the user is forced to confirm the reload by the browser).
2. Put a cheesy blurb on the page telling the user to reload or refresh
(along with ideotic explanations of how to do it).
3. Some really great way someone here is going to describe to me (my
preference).

PHP Form Keeps Resending Information On Reload.
I have PHP form that is basically a contact page when the user clicks on submit. I have the page update with your message that says it has been sent, but now if the user clicks on reload it ask to resubmit the information over again. And that's where i want to stop this so when the user clicks on reload it will not resubmit the information again. How can this be done?

Script Termination And Reload After 5 Minutes
Strange problem on a lamp installation: A script runs longer than 5
minutes and sends no output to the browser until it is finished. When
called at customer site it gets stopped after exactly 5 minutes and is
reloaded automatically 4 times, then it gives up. This is logged in
Apache access log.

I have no clue what causes the reload after 5 minutes of "no data
received". Could be the browser, could be the proxy. I even do not have
a problem with the behaviour, you could avoid that by sending something
to the browser periodically.

BUT: The script gets stopped completely after the 5 minute period. That
is what I dont like... No PHP log entry, no apache log entry about that.
Just like killed. "ignore_user_abort" is enabled in PHP configuration.

Any ideas what causes the script termination and how that can be avoided?

Configuration details:

Making Apache To 'reload' Its Configuration
I am having problems making Apache reload itself.

I have tried a PHP exec calling a bash shell script that does a KILL -HUP on
Apache to attempt to make it reload its configuration.

The signal in the shell script works fine from root but will not work when
called from PHP.

Is there anyway to make Apache reload itself from PHP without having to
doing a signal ?

I am trying to do a configuration reload without requiring root.

Server Can Not See Cookie Until After Second Reload/refresh?
I'm sending the code that displays messages only when the server does not see a cookie. However unlike ASP PHP does not see a cookie until the second reload. This would have the code and message appear after the user has made a choice and I'd have to make the page reload so the server sees the cookie (on the second reload) and then does not send the code/message on the third load, but I want to avoid this. What is this issue? How can I get around it?

File Form - Keep Local Path Info On Reload
Is there a way to retain the local path info for a file form when the page reloads?

How Can I "reload" The Values Of A Field
I try to "reload" the value of a form - field called name each time the form
is being reloaded. I put this code in the php script:

session_start();
if (isset($name)){
$_SESSION['name'] = $name;
} else {
$name = $_SESSION['name'];
}
......
<input type="text" name="name" value="echo $name;">

however, when I restart the IE Browser and reload the url, then I do NOT get
the value of $name. What do I do wrong?

Reload Existing Window From Another Window
I have logg in page, after clicking loggin the pop up window apiears and
if user loggins it closes,
I want to reload if loggin succes ( I have handling sistem for it) ,page
were user have clicked to logg in, how do I do it?
is it possible to do it with php?

Header Content-Type For PHP&GD For Mobile?
I have a php script which, using GD will echo out an image file using parameters for my wapsite.

So it would look something like: <img src="getimage.php?imageID=10000">

At the top of the page I set: header ("Content-type: image/gif")

I need this however to work when viewing from a mobile phone. Is there a specific type of "Content-type" for mobile phones to display gif/png/jpeg/etc. using my getimage.php ?

How To Parse RSS Feeds By Php Code ? Cannot Set Header File Type (xml)
I want to generate a feed file dynamically inside a .php file, but in my browser it looks like a plain file even if the source file contains the right tags, I simplified it to this code (attached), is the header info incorrect or why does the browser read it like a plain file? Code:

Loading A Page With Ajax Or Sajax?
Well i have a problem i want to be able to run my messenger and music
player or every page on my site just right now not much of the site is
using Ajax or sajax, is there a way to load a php document in the page
without having to reload my messenger or music player?

Using AJAX, How Can The Page Get State Infomation From Backgroud PHP Script?
I'm not familiar with web programming, but I have a problem here.

I have a page. When a user click one button on it, I will use AJAX to
request a PHP script which will do a bunch of tasks, asynchronously.
These tasks might take long time so I want to keep the user informed
of the progress. The problem is that only the PHP script knows the
progress, how can the web page gets these information from PHP script?

A Web Development QUICK LINK PAGE (QLP) - HTML, Perl, PHP, JavaScript, AJAX, CGI, Etc.
I've recently organized and even color-coded many of my favorite
bookmarks on WEB DEVELOPMENT (and a few other favorite subjects too)
into what I call QUICK LINK PAGES. These are very condensed, compact
(no graphics), fast-loading pages with a 100+ links to some of my
favorite web sites on a particular subject. I hope you'll give them a
try...

Here's the link...

The easy-to-remember link above gets you to one of the Quick Link Pages
(QLP). The current categories (DIVERSIONS, INVESTING, JAZZ, MACINTOSH,
OPERA, PHYSICS (with ASTRONOMY and MATHEMATICS), SPORTS, WEB
DEVELOPMENT, and WINDOWS) are color-coded on the top of every page.
Just click your favorite category. I hope you'll find a lot to enjoy.
If you find any errors, or have suggestions for additional links or
categories,

Send Header Info To A Page, Retrieve Response And Send That As Header
I am sending a header to page.html from sender.php using fgets(). I am then trying to retrieve that page's response, and set that as a header in sender.php in order to set any cookies etc.... that page.html might want to set. Right now I am using the following code:

AJAX:: Using AJAX To Improve The Bandwidth Performance Of Web Applications
This is an amazing example of increasing bw performance using ajax. a
must see for all

visit:
http://webperformanceinc.com/library/reports/AjaxBandwidth/index.html

Header() To Redirect A Page
I know that you can use header() to redirect a page, but that you have to use it before any script executes; How do you redirect the page after the script executes?

Imagejpeg Generating String Not Image Even With Header("Content-type:image/jpeg")
does anyone know why i can't generate images with:
header("Content-type:image/jpeg");
imagejpeg($img_number);

i've tried different examples but i always get a text output as if the
header doesn't make a difference at all.

<?php
//random_number.php
$img_number = imagecreate(100,50);
$white = imagecolorallocate($img_number,255,255,255);
$black = imagecolorallocate($img_number,0,0,0);
$grey_shade = imagecolorallocate($img_number,204,204,204);

imagefill($img_number,0,0,$grey_shade);
ImageRectangle($img_number,5,5,94,44,$black);
ImageRectangle($img_number,0,0,99,49,$black);

header("Content-type:image/jpeg");
imagejpeg($img_number);
?>

Using An Include Header Pushes My Page.
When I try to use the "include" to add in a header file, php put my header flush left and the all the html flush right. The footer seems to work fine but for some reason I cant get the header to work right any ideas? ....

Printing New Table Header On Every Page
I query a database and print the info in a table.I need to print a new table header on each new page. Do I need to embed another loop somewhere so that like every 20 rows print a new table header, if so how, and where? Thank you so much for any help. Here is my code:


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