Dinamic load and php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fredi_bieging
Forum Newbie
Posts: 1
Joined: Tue May 08, 2007 8:34 am

Dinamic load and php

Post by fredi_bieging »

hi,

I have a page with basically three divs.. a header, a sidebar and one for the content. so, a load my php scripts into the content div clicking on the sidebar options... ok, when submit a form in these scripts I would like to return to the same script i was before.. but.. If I use something like:

Code: Select all

header("Location: myscript.php");
this redirects to that script, and I loose my "css framed" structure. is there a way of redirecting just for that div?
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

To change only one "part" of a page you need javascript. AJAX is a common method of doing this. The only other way of doing this is to work out some way of passing parameters as if part of a form ($_GET or $_POST) via a form submit or appending the

Code: Select all

header("Location: myscript.php");
with a $_GET string.

Code: Select all

header("Location: myscript.php?sub=2");
Hope that's understandable.
Post Reply