winmastergames Posted January 20, 2008 Share Posted January 20, 2008 Well im making a script so users can make there own website for free and stuff. But is possible to have a form that uses the GET function and submits it and that link stuff comes out like this page.php?name=bob&last=gates I want that code after they have submited it to go into the Textbox where they first clicked the link to Add Page If you know what i mean?? its kind of confusing Quote Link to comment https://forums.phpfreaks.com/topic/86856-solved-help-with-my-php-scripts/ Share on other sites More sharing options...
pkSML Posted January 20, 2008 Share Posted January 20, 2008 Yah, your quandry is confusing... You can access form variables submitted by the GET method as $_GET['name'] and $_GET['last'] -OR- $_REQUEST['name'] and $_REQUEST['last'] (this method gets variables submitted with either GET or POST) Quote Link to comment https://forums.phpfreaks.com/topic/86856-solved-help-with-my-php-scripts/#findComment-443945 Share on other sites More sharing options...
Fyorl Posted January 20, 2008 Share Posted January 20, 2008 Sending textarea data via get is a bad idea as you'll run over the address' character limit. Quote Link to comment https://forums.phpfreaks.com/topic/86856-solved-help-with-my-php-scripts/#findComment-443953 Share on other sites More sharing options...
winmastergames Posted January 20, 2008 Author Share Posted January 20, 2008 Yea i tried that its a bad idea... But what about is there a way that you can fill out a form on a page and there is another form below that one where it has some textboxes to place the stuff like page.php?name=bob&last=gates Right and places the code there and there will be 4 buttons like place in textbox 1 and 2,3,4 like that Is that possible? Quote Link to comment https://forums.phpfreaks.com/topic/86856-solved-help-with-my-php-scripts/#findComment-443973 Share on other sites More sharing options...
winmastergames Posted January 20, 2008 Author Share Posted January 20, 2008 Ill give you the Form Code i have here <form action="index.php" method="get"> Title: <input type="text" name="title" /><br> slogan: <input type="text" name="slogan" /><br> <br> Paragraph 1 Title: <input type="text" name="para-1" /><br> Paragraph 1 Section 1 Body: <input type="text" name="para-1sec1body" /><br> Paragraph 1 Section 2 Body: <input type="text" name="para-1sec2body" /><br> Paragraph 1 Section 3 Body: <input type="text" name="para-1sec3body" /><br> <br> Paragraph 2 Title: <input type="text" name="para-2" /><br> Paragraph 2 Section 1 Body: <input type="text" name="para-2sec1body" /><br> Paragraph 2 Section 2 Body: <input type="text" name="para-2sec2body" /><br> <br> Sidebar 1 Title: <input type="text" name="sidebar1title" /><br> Sidebar 1 Body: <input type="text" name="sidebar1body" /><br> <br> Sidebar 2 Title: <input type="text" name="sidebar2title" /><br> Sidebar 2 Body: <input type="text" name="sidebar2body" /><br> <br> Sidebar 3 Title: <input type="text" name="sidebar3title" /><br> Sidebar 3 Body: <input type="text" name="sidebar3body" /><br> <br> Link 1 Text: <input type="text" name="link1text" /><br> Link 1 Url: <input type="text" name="link1url" /><br> Link 2 Text: <input type="text" name="link2text" /><br> Link 2 Url: <input type="text" name="link2url" /><br> Link 3 Text: <input type="text" name="link3text" /><br> Link 3 Url: <input type="text" name="link3url" /><br> Link 4 Text: <input type="text" name="link4text" /><br> Link 4 Url: <input type="text" name="link4url" /><br> <input type="submit" /> </form> And at the bottom there is link 1 url link 2 url and 3 and 4 Thats where i want the code to be Quote Link to comment https://forums.phpfreaks.com/topic/86856-solved-help-with-my-php-scripts/#findComment-443976 Share on other sites More sharing options...
Fyorl Posted January 20, 2008 Share Posted January 20, 2008 I'm still not quite sure what you want, your 'sentences' don't make that much sense. Are you sure you don't want Javascript to accomplish this? Quote Link to comment https://forums.phpfreaks.com/topic/86856-solved-help-with-my-php-scripts/#findComment-443980 Share on other sites More sharing options...
winmastergames Posted January 20, 2008 Author Share Posted January 20, 2008 well i have a PHP script HERE <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title><?php echo $_GET["title"]; ?> - <?php echo $_GET["slogan"]; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="style.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- .style1 {color: #A53512} --> </style> </head> <body> <!-- COPYRIGHT INFORMATION -+-+-+-+-+-+-+-+-+-+- If you wish to use this template for a non-profit organisation, such as state funded schools & colleges, charities, blogs etc, then you are free to do with the copyright information as you wish. I would appreciate a link back, but it isn't neccessary. For all other users of this template, please leave the copyright info in the footer intact. I made this template in my own time, and all I ask is you leave the copyright info intact so that others can find the oswd site and me! If you wish to remove the copyright information, I can not stop you, but a donation would be appreciated. To get in touch email me at info@now-design.co.uk or simply paypal to that same address. Good luck, if you are struggling with the modification, do get in touch as I am available for paid work. Thanks! Tjobbe Andrews - NOW:design - info@now-design.co.uk --> <!-- This design is part of the [in] business template downloaded from the oswd.org site The stylesheet and template where made by Tjobbe Andrews from NOW:design www.now-design.co.uk --> <div class="all"> <div class="box"> <!-- The menu, tabs --> <div class="menu"><a href="<?php echo $_GET["link1url"]; ?>"><?php echo $_GET["link1text"]; ?></a><a href="<?php echo $_GET["link2url"]; ?>"><?php echo $_GET["link2text"]; ?></a><a href="<?php echo $_GET["link3url"]; ?>"><?php echo $_GET["link3text"]; ?></a><a href="<?php echo $_GET["link4url"]; ?>"><?php echo $_GET["link4text"]; ?></a></div> <!-- The header --> <div class="header"><img alt="" style="float:right; " src="images/www.jpg" width="225" height="95" /> <h1><?php echo $_GET["title"]; ?></h1> <div class="clearfix"></div> </div> <!-- the news bar, or right hand column --> <div class="newsbar"> <h1><?php echo $_GET["sidebar1title"]; ?></h1> <div class="p2"><?php echo $_GET["sidebar1body"]; ?></div> <h1><?php echo $_GET["sidebar2title"]; ?></h1> <div class="p2"> <p><?php echo $_GET["sidebar2body"]; ?></p> </div> <h1><?php echo $_GET["sidebar3title"]; ?></h1> <div class="p2"> <p><?php echo $_GET["sidebar3body"]; ?></p> </div> </div> <!-- main content area--> <div class="content"> <h1><?php echo $_GET["para-1"]; ?></h1> <p><?php echo $_GET["para-1sec1body"]; ?></p> <p><?php echo $_GET["para-1sec2body"]; ?></p> <div class="p1"><?php echo $_GET["para-1sec3body"]; ?></div> <h1><strong><?php echo $_GET["para-2"]; ?></strong></h1> <p><?php echo $_GET["para-2sec1body"]; ?></p> <p><?php echo $_GET["para-2sec2body"]; ?></p> </div> <div class="clearfix"></div> <!-- footer, copyright area - please do not remove!--> <div class="footer"><?php echo $_GET["title"]; ?> © 2008 | Template from <a href="http://www.oswd.org/">oswd.org</a></div> </div> </div> </body> </html> And there is the <?php echo $_GET["title"]; ?> In and around the script and well that script is a template as you can see. and then I have the following form so you can put a title and text into the webpage But now i want it so you can have multipule pages and on the form i have URL 1 url 2 url 3 url 4 I want another form that can insert the URL into there when they have made another page Like on this Page you will have this Come out after you have Put all your Text in index.php?title=Welcome+To+a+website&slogan=Great+this+is+cool¶-1=Welcome¶-1sec1body=Welcome+to+bobnarly%27s+website+please+use+the+link+above+to+navigate+around¶-1sec2body=More+Text¶-1sec3body=More+Text¶-2=More+Text¶-2sec1body=More+Text¶-2sec2body=More+Text&sidebar1title=More+Text&sidebar1body=More+Text&sidebar2title=More+Text&sidebar2body=More+Text&sidebar3title=More+Text&sidebar3body=More+Text&link1text=&link1url=&link2text=&link2url=&link3text=&link3url=&link4text=&link4url= But when a another page is greated like Page 2 i want the Text to be inserted into URL 2 on the Form thats coming up below How will i do this Or is there a better way to do this HERE is the FORM <form action="index.php" method="get"> Title: <input type="text" name="title" /><br> slogan: <input type="text" name="slogan" /><br> <hr> Paragraph 1 Title: <input type="text" name="para-1" /><br> Paragraph 1 Section 1 Body: <input type="text" name="para-1sec1body" /><br> Paragraph 1 Section 2 Body: <input type="text" name="para-1sec2body" /><br> Paragraph 1 Section 3 Body: <input type="text" name="para-1sec3body" /><br> <hr> Paragraph 2 Title: <input type="text" name="para-2" /><br> Paragraph 2 Section 1 Body: <input type="text" name="para-2sec1body" /><br> Paragraph 2 Section 2 Body: <input type="text" name="para-2sec2body" /><br> <br> Sidebar 1 Title: <input type="text" name="sidebar1title" /><br> Sidebar 1 Body: <input type="text" name="sidebar1body" /><br> <br> Sidebar 2 Title: <input type="text" name="sidebar2title" /><br> Sidebar 2 Body: <input type="text" name="sidebar2body" /><br> <hr> Sidebar 3 Title: <input type="text" name="sidebar3title" /><br> Sidebar 3 Body: <input type="text" name="sidebar3body" /><br> <hr> Link 1 Text: <input type="text" name="link1text" /><br> Link 1 Url: <input type="text" name="link1url" /><br> Link 2 Text: <input type="text" name="link2text" /><br> Link 2 Url: <input type="text" name="link2url" /><br> Link 3 Text: <input type="text" name="link3text" /><br> Link 3 Url: <input type="text" name="link3url" /><br> Link 4 Text: <input type="text" name="link4text" /><br> Link 4 Url: <input type="text" name="link4url" /><br> <hr> <input type="submit" /> </form> Quote Link to comment https://forums.phpfreaks.com/topic/86856-solved-help-with-my-php-scripts/#findComment-443986 Share on other sites More sharing options...
winmastergames Posted January 20, 2008 Author Share Posted January 20, 2008 If you want to see it in action with what i have now go here http://www2.winmastergames.com:81/makeeasywebsite.php Quote Link to comment https://forums.phpfreaks.com/topic/86856-solved-help-with-my-php-scripts/#findComment-443988 Share on other sites More sharing options...
Fyorl Posted January 20, 2008 Share Posted January 20, 2008 Still unclear but perhaps you can use hidden inputs to retain the data between forms. Either that or some kind of database interaction. Quote Link to comment https://forums.phpfreaks.com/topic/86856-solved-help-with-my-php-scripts/#findComment-443991 Share on other sites More sharing options...
winmastergames Posted January 20, 2008 Author Share Posted January 20, 2008 Yea ill think about it a bit more then if i have problems ill be back!! Ill say this is Solved but cya Quote Link to comment https://forums.phpfreaks.com/topic/86856-solved-help-with-my-php-scripts/#findComment-444003 Share on other sites More sharing options...
winmastergames Posted January 20, 2008 Author Share Posted January 20, 2008 I thought about it a bit more and here is a diagram As you can see the user will type in the top form and there are 4 buttons i want them to submit the index.php?title=Welcome&slogan=Welcome and so on into the textboxes at the bottom with URL 1,2,3 and 4 Is that more understanding Quote Link to comment https://forums.phpfreaks.com/topic/86856-solved-help-with-my-php-scripts/#findComment-444011 Share on other sites More sharing options...
Fyorl Posted January 20, 2008 Share Posted January 20, 2008 Yep, I think I understand now. You need javascript for this, not PHP. Quote Link to comment https://forums.phpfreaks.com/topic/86856-solved-help-with-my-php-scripts/#findComment-444019 Share on other sites More sharing options...
winmastergames Posted January 20, 2008 Author Share Posted January 20, 2008 Oh and where will i find that ??? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/86856-solved-help-with-my-php-scripts/#findComment-444021 Share on other sites More sharing options...
Fyorl Posted January 20, 2008 Share Posted January 20, 2008 I think there may be a forum here devoted to Javascript. You could also try <a href="http://www.justfuckinggoogleit.com/search.pl?query=javascript">this</a>. Quote Link to comment https://forums.phpfreaks.com/topic/86856-solved-help-with-my-php-scripts/#findComment-444027 Share on other sites More sharing options...
winmastergames Posted January 20, 2008 Author Share Posted January 20, 2008 Umm and i already did there isnt much to do what im trying to do Quote Link to comment https://forums.phpfreaks.com/topic/86856-solved-help-with-my-php-scripts/#findComment-444030 Share on other sites More sharing options...
Fyorl Posted January 20, 2008 Share Posted January 20, 2008 *Sigh* <script type="text/javascript"> var inputs = document.getElementsByTagName('input'); var urlstr = 'index.php?'; for(var i = 0; i < inputs.length; i++) { var input = inputs[i]; if(input['name'].substr(0, 4) == 'link') continue; if(urlstr != 'index.php?') urlstr += '&'; urlstr += input['name'] + '=' + input['value']; } </script> That will create your index.php?blah=blah&blah2=blahblah in the variable 'urlstr'. Now all you need to do is attach onlick events to your four buttons to give the link boxes the value of urlstr. I also refuse to write any more code for you because I'm tired, I hate javascript and I think that if you manage to do the rest yourself you'll be much better off than if I had told you. Quote Link to comment https://forums.phpfreaks.com/topic/86856-solved-help-with-my-php-scripts/#findComment-444037 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.