|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Form to submit values to php script in 'I-frame'
I haven't come across this before, but is it possible to make the results of php script (echoing fields from records) present itself within an 'I-frame' within an HTML page? At the moment my results list down a rather bland page in a table after checking boxes & clicking the submit, and you scroll down the page to view them. I would nice to present the table in it's own frame with scroll bar within a fixed page rather like the area we have type in these message threads, and the main page remains fixed.
I have thought about adapting the html function:- <iframe src='http://www.google.com' border='1' name='tagboard' width="720" height="380" frameborder="0" framespacing="1"></iframe><br> in the checkbox form page, but I can't see how to fit this in with the action="phpscript.php". I suppose it's all about posting to a php script within an html page. Sorry, it maybe a question for another section but it is a sort of php issue. |
|
#2
|
|||
|
|||
|
I think what you'd have to do is set another php page as your action -- this page will contain your HTML shell and the form information. You can then set up your iframe in it, passing your form info through the url.
If you're just unhappy with the presentation of your page, though, I'd look into other methods of fixing it up. |
|
#3
|
||||
|
||||
|
Thanks Madpawn, yes I've read about parsing info thru the url, but sounded too much like rocket science so have not gone down that route. Looks like I'll have to face it or take your advise and look into other ways to present it. I mean, I can't be the only one that have thought "ummm, maybe there's more to this than Times Roman on a white background!".
|
|
#4
|
|||
|
|||
|
Quote:
You don't have to parse the URL. Just put the iframe on the page you want and have src="intermediate.php". Then put your form HTML in intermediate.php with action="script.php" and method=POST. Works great ... iframes rule! [[[page with iframe]]] <iframe name="iframe1" src="intermediate.php" height="100" width="400" scrolling="auto"> </iframe> [[[form page - intermediate.php]]] <form action="script.php" method="POST"> <textarea name="idlist" rows="20" cols="20"></textarea><br> <input type="submit" name="button"> </form> [[[script.php]]] <?php $db = mysql_connect("localhost", "administrater", "HAZAAH!"); mysql_select_db("somedb",$db) or die("Cannot select the database.<br>" . mysql_error()); $idlist = $_POST['idlist']; Nick |
|
#5
|
||||
|
||||
|
Hi dgmarigold! This all sounds jaw-droppingly simple- what's the catch?!
OK, please let me get this straight:- Selections are made with say Checkboxes in my HTML form page with special secret code of <textarea name="idlist" etc etc Arrays get parsed to the script.php after that submit button get pressed, with the $idlist=$_POST['idlist']; included. and...HAZAAH! (I know your password now!) it all get dumped into a page with an iframe which contains your code. Thanks mate! I owe you a pint of Guinness! |
|
#6
|
||||
|
||||
|
Thanks Nick
I tried it out, and it works well as long as you get the right size of frame for whatever is in the form page, checkboxes, textarea etc so as to not introduce the sliders of the i-frame. Thanks again. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Form to submit values to php script in 'I-frame' |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|