last day (14 days later) » 

2:32 PM
1
A: Get the Value from another PHP page

Muhammet<?php $link_address="viewsensordata.php?view=".$view; ?> <form method="post" action="<?php echo $link_address;?>"> <select id="refresh" name="refresh"> <option value="-">Select Seconds</option> <option value="1">1 Second</option> <option value="2">2 Seconds</option> <option value="3"

 
So in the second page i will add the code that you wrote and how i will alter this part <meta http-equiv="Refresh" content="0;URL=refreshsensorData.php?refresh=<?php echo $refresh;?>">
 
@DogFace Depends on what you want, if you don't submit the form on first page, it will refresh do refreshsensorData.php after x seconds, there you can still access session. If you do submit the form before refresh, you will still be able to get session value in viewsensordata.php page.
 
What I want to do is to select from the form in the first page the seconds for the refresh rate and then in the second page to refresh my page with the selected refresh rate.
 
@DogFace Check the updated answer, then you simply access value of $_POST['refresh'] in your second page and set a refresh meta header
 
Ok I did what you write but it will refresh the page only once , I want to refresh the page for example every 3 seconds if i selected 3 from the form
And also why you delete this code from the first page <meta http-equiv="Refresh" content="<?php echo $refresh;?>;URL=refreshsensorData.php">
 
2:32 PM
@DogFace because it will refresh the page that has the form, you don't want that, do you ?
 
If i delete it then the form does not do anything
Hello
I have another question which I am trying to do it in one single page
0
A: Refresh Rate Button Php for Firefox and Chrome

user2883814as I know you need add the tag: <meta http-equiv="Refresh" content="<?php echo $refresh;?>;URL=sensorData.php"> between <head> </head> tags, before the body tag

 
what is the name of your second page
 
Is this easier instead of two pages?
viewsensordata2.php
 
there ?
 
what do you mean with there ? :P
 
2:37 PM
ok
so you have 1st page where you have form
right
 
yes
and i want to select the refresh rate of the page
for example if i select 3 seconds
 
and then you select seconds, click submit it goes to second page and when it goes there, second page is supposed to refresh every x seconds from the form
 
then i want to refresh the page every 3 sec
yes
 
can you send me your two pages
that way i can test them and it is easier
 
ok
how can I upload a file here?
 
2:40 PM
save them pastie.org
there
 
pastie.org/10260325 (first page)
pastie.org/10260326 (second page)
first page = viewsensordata.php
second page = viewsensordata2.php
 
first page
second page
copy the code to your pages accordingly
i can not edit your exact page, because there are database connections and so on
so what happens is, you submit the form, it goes to 2nd page, sets refresh second to x, and url to secondpage.php?refresh=3 then script is made to get that 3 second value from url, so it keeps refreshing. if you go straight to secondpage.php it will refresh every 10 seconds, you can change that if you want.
 
ok i will check it now
 
and make sure you have proper html document with closing tags and so on
think like a computer, then you will be able to solve most of the problems yourself.
 
http://pastie.org/10260338 (first page)

http://pastie.org/10260339 (second page)

i dont have any error in both codes but it does not work.
 
2:55 PM
$link_address="viewsensordata2.php?view=".$view;
make it viewsensordata2.php
since you are submitting form to second page
i think you are already loading header.php
in second page
maybe remove include_once 'header.php'; from second page and put its contents inside head tag
were you able to solve it
if you have teamviewer ?
i can login and fix it quickly
 
ok i will send you my teamviewer password
id : 447 502 713
password 1766
I want to get data from another page refreshSensorData
wait a sec
it seems that it doesnt get the data for the logged in user
we can try to make it refresh only the first page as I have it in the begining
let me show you
but i dont want to refresh it only once i want to refresh it all the time with refresh rate 3 for example
ok
why dont we try to make it refresh only the first page and not the other
you want to refresh first page or second ? which one ?
if it is possible to make it refresh continiously the first page it will be great. for example i want the refresh rate to be 3 and it will refresh my page only once i want it to do it continously
ok but when you select 3 seconds do you want to refresh that same page, or the second page
same page
we want the username
got it
it refreshs but it doesnt get the new data
what data ?
when i click on refresh it will execute the code of sensorData.php
let me take it from the beginning
when i click on refresh it will execute the code of sensorData.php
every 5 seconds for example
and these data will display it to my page
let me show you
 
3:46 PM
works now
yes you did it :D
but make sure you dont refresh too often, because it is kind of bad. this is absolutely not secure to public, if you are using it for yourself, i would say ok.
it is a project for my college i will not publish it so i think it is ok :P
some of the others if you can :D i dont want to annoy you but :D oh sure but i cant upvote many in a day because they will "get" us :p yeah , if we do a lot of upvotes in a day to a single user they will remove that upvotes
yeah, that is good, thank you :) you re welcome
 

last day (14 days later) »