PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 1st, 2005, 08:02 AM
SnapCracker's Avatar
SnapCracker SnapCracker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Kent, United Kingdom
Posts: 165 SnapCracker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 21 h 22 m 31 sec
Reputation Power: 4
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.

Reply With Quote
  #2  
Old February 1st, 2005, 09:58 AM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 4
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.

Reply With Quote
  #3  
Old February 1st, 2005, 11:33 AM
SnapCracker's Avatar
SnapCracker SnapCracker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Kent, United Kingdom
Posts: 165 SnapCracker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 21 h 22 m 31 sec
Reputation Power: 4
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!".

Reply With Quote
  #4  
Old February 11th, 2005, 03:33 PM
dgmarigold dgmarigold is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 1 dgmarigold User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m
Reputation Power: 0
Thumbs up Easy as 123

Quote:
Originally Posted by SnapCracker
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!".


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

Reply With Quote
  #5  
Old February 14th, 2005, 03:31 PM
SnapCracker's Avatar
SnapCracker SnapCracker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Kent, United Kingdom
Posts: 165 SnapCracker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 21 h 22 m 31 sec
Reputation Power: 4
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!

Reply With Quote
  #6  
Old February 15th, 2005, 02:31 PM
SnapCracker's Avatar
SnapCracker SnapCracker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Location: Kent, United Kingdom
Posts: 165 SnapCracker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 21 h 22 m 31 sec
Reputation Power: 4
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Form to submit values to php script in 'I-frame'


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway