Page 1 of 2
calling a php page from a client withought redirection
Posted: Mon Dec 15, 2003 3:08 am
by pelegk2
i want to call from a client by pressing a button
a php file that will update a DB
but i dont want to use a forum that will redirect my page or refresh it
so s it possible?then how?
thanks in advance
peleg
Posted: Mon Dec 15, 2003 4:10 am
by twigletmac
Not possible, PHP is server-side you must make a call to the server (via redirect or refresh) in order to run a PHP script.
Mac
Posted: Mon Dec 15, 2003 4:14 am
by malcolmboston
javascript autorefresh not possible?
Posted: Mon Dec 15, 2003 4:17 am
by Nay
How about maybe you have a hidden iframe, and after the action is done, it launches a pop-up window or something?
Just a thought...
-Nay
Posted: Mon Dec 15, 2003 4:19 am
by malcolmboston
yeah 1px by 1px frame would do it and invidible to the user
good idea, ive done this before and it works
(i used it to play music through the whole site even whilst refreshing, worked a charm and no-one was none the wiser)
technically that should work
Posted: Mon Dec 15, 2003 4:23 am
by Nay
Or....
Code: Select all
<iframe style="display:none"></iframe>
// or also
<iframe style="visibility:hidden"></iframe>
I started as a designer so knowing there's an extra width without changing it, never gets off your mind. You then breathe out in relief after it's gone

.
-Nay
Posted: Mon Dec 15, 2003 4:31 am
by igoy
either user Javascript Remoting (try googling it), I have read about it in some local magazine. using Javascript remoting you can make a call to server-side page (PHP, ASP) without going to another page.
another way is you can use Flash (LoadVars object).
Posted: Mon Dec 15, 2003 4:33 am
by Nay
Now I wonder if anyone has a Flash Backend o.O.
-Nay
Posted: Mon Dec 15, 2003 4:35 am
by pelegk2
ok i solved it easilt using new ActiveXObject("Microsoft.XMLHTTP");
Posted: Mon Dec 15, 2003 4:43 am
by igoy
what do you mean by Flash Backend, Nay ? o_O
Posted: Mon Dec 15, 2003 5:07 am
by Nay
i want to call from a client by pressing a button
My wacko brain guesses that this script is most probably in an administration panel (backend) where he manages them (the clients). So unless the whole world is going to see it, I don't see a point of using Flash.
-Nay
Posted: Mon Dec 15, 2003 5:11 am
by m3mn0n
iframe might do it, but what about all the Mozilla/Netscape people?
Posted: Mon Dec 15, 2003 5:13 am
by malcolmboston
:bump: get a better browser :bump:
Posted: Mon Dec 15, 2003 5:15 am
by Nay
Then if you can sacrifice a height about 1 or 2 px, you can have a good ol' normal frame, hidden borders and all at the top or bottom.
That should work on all browsers.
-Nay
Yeah, Nay and his crazy ideas

.
Posted: Mon Dec 15, 2003 5:19 am
by malcolmboston
iframes at the moment should be avoided, just as CSS2, object classes etc should be avoided until several 'unnamed' browsers catch up.
just use frames, no border like nay said, frames are awful and have never personally used them but looks like the only way around this problem and at least browsers support it
not sure why you dont just do it the normal way though, seems like no drawback to me