473,387 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

function to refresh a page

2
Hi guys
I'm new in php, and i need a php function that allows the page to refresh while resending information the same information that was sent to it earlier. Does this function actually exist?
Jan 28 '08 #1
4 2755
U can use the header() in php function pass the location in header if u redirect the same page call the same url..

There are another way in html there are <meta> tag set the refresh time and refresh the page every time how thet u set the time in milisec.

Sandeep Agrawal
Jan 28 '08 #2
tedzz
2
U can use the header() in php function pass the location in header if u redirect the same page call the same url..

There are another way in html there are <meta> tag set the refresh time and refresh the page every time how thet u set the time in milisec.

Sandeep Agrawal

I tried the header function... the problem is that it is not resending the same information..when the page refreshes all the submitted information is lost
Jan 28 '08 #3
Markus
6,050 Expert 4TB
I tried the header function... the problem is that it is not resending the same information..when the page refreshes all the submitted information is lost
Either, send the data through the url:
[php]
header("Location: http://example.com/?var=something&var2=something-else
[/php]

Then use $_GET to retrieve it:
[php]
$_var = $_GET['var']'
$_var2 = $_GET['var2'];
[/php]

OR! You could have hidden input fields (in a form), which you have populated with the data, then use javascripts setInterval() to submit the form after a period of time.
Expand|Select|Wrap|Line Numbers
  1. document.form_name.submit()
  2.  
:)
Jan 28 '08 #4
dlite922
1,584 Expert 1GB
Either, send the data through the url:
[php]
header("Location: http://example.com/?var=something&var2=something-else
[/php]

Then use $_GET to retrieve it:
[php]
$_var = $_GET['var']'
$_var2 = $_GET['var2'];
[/php]

OR! You could have hidden input fields (in a form), which you have populated with the data, then use javascripts setInterval() to submit the form after a period of time.
Expand|Select|Wrap|Line Numbers
  1. document.form_name.submit()
  2.  
:)
basically you just want to hit the refresh button, this has nothing to do with PHP as it is on the client side, create a link for the page itself or the following will work too:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <a href="javascript:location.reload(true);">
  3. Refresh this page
  4. </a>
  5.  
header() is used when redirecting from the server.
Jan 29 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Colin Steadman | last post by:
I have created a function to kill all session variables that aren't in a safe list. This is the function - Sub PurgeSessionVariables For Each Item In Session.Contents Select Case Trim(Item)...
3
by: Scott | last post by:
I have a clickable graph that resides on page 1. If user clicks a data point on the graph, the page runs again yeilding a 2nd graph that shows a more detailed graph. Problem is, I have a...
1
by: Marco Maroni | last post by:
How to force image refresh on client browser ? Is ti possible to force the refresh of the same image (tha was changed server-side) to the client, without user press Contrl+F5 in IE ? - Marco
9
by: PK9 | last post by:
I'm having an issue with the "Refresh" of an asp.net page. The refresh is actually calling my last onClick event. I thought that asp.net was supposed to be stateless in that it shouldn't...
0
by: Brad White | last post by:
Overview: I have a custom web app that has an 'Inbox' that refreshes every 30 seconds. One user uses Outlook to host the web page. Using IE, the refresh works fine. If the user is working in...
3
by: Kevin | last post by:
Hi guys, I want to refresh some pages every 2 seconds. however, these html pages are not in my site, they could be any pages from yahoo.com or msn.com. I can create a page, which redirect to...
10
by: Fred Nelson | last post by:
Hi: I have a VB.NET web application and I need to find a way to cause a page refresh from within my application. Does anyone know how to force the browser to refresh the current page? ...
1
by: Donkey Cart Racer | last post by:
Hi, I have a page - page1 which opens a window1 where users can look at tasks, in window1 users can click and open window2 where they can create new tasks I want to refresh window1 when...
4
by: badaczewski | last post by:
The following javascript appears on a popup window. <script language="javascript" type="text/javascript"> function InsertContact(value) { window.opener.CallBackContact(value); window.close();...
19
Dheeraj Joshi
by: Dheeraj Joshi | last post by:
Hi... I have a php script which has a function call and function returns a value. But when i open it in browser and refresh the page the return value will get added to the old value. Code...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.