Pages: [1] :: one page |
|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |
Saai Einjhar
|
Posted - 2008.11.04 21:28:00 -
[1]
Hey. I've been going at this for a while I decided I should ask for some help ;P
I have no prob (it seems) making php forms for regular internet/webpage use. Just can't immitate that in eve using the igb.
An example of a form I'm using (content irrelevant)
<?php $Fname = $_POST["Fname"]; $Lname = $_POST["Lname"]; $gender = $_POST["gender"]; $food = $_POST["food"]; $quote = $_POST["quote"]; $education = $_POST["education"]; $TofD = $_POST["TofD"]; if (!isset($_POST['submit'])) { // if page is not submitted to itself echo the form ?> <html> <head> <title>Personal INFO</title> </head> <body> <form method="post" action="<?php echo $PHP_SELF;?>"> First Name:<input type="text" size="12" maxlength="12" name="Fname"><br /> Last Name:<input type="text" size="12" maxlength="36" name="Lname"><br /> Gender:<br /> Male:<input type="radio" value="Male" name="gender"><br /> Female:<input type="radio" value="Female" name="gender"><br /> Please choose type of residence:<br /> Steak:<input type="checkbox" value="Steak" name="food[]"><br /> Pizza:<input type="checkbox" value="Pizza" name="food[]"><br /> Chicken:<input type="checkbox" value="Chicken" name="food[]"><br /> <textarea rows="5" cols="20" name="quote" wrap="physical">Enter your favorite quote!</textarea><br /> Select a Level of Education:<br /> <select name="education"> <option value="Jr.High">Jr.High</option> <option value="HighSchool">HighSchool</option> <option value="College">College</option></select><br /> Select your favorite time of day:<br /> <select name="TofD" size="3"> <option value="Morning">Morning</option> <option value="Day">Day</option> <option value="Night">Night</option></select><br /> <input type="submit" value="submit" name="submit"> </form> <? } else { echo "Hello, ".$Fname." ".$Lname.".<br />"; echo "You are ".$gender.", and you like "; foreach ($food as $f) { echo $f."<br />"; } echo "<i>".$quote."</i><br />"; echo "You're favorite time is ".$TofD.", and you passed ".$education."!<br />"; } ?>
Its a php form which returns the answers back to itself... so the page goes from being the form to being the answers... yeah?
I was thinking perhaps you need to trust the site before the igb will let you do this? It doesn't change to answers after being filled out.
Any help on this would be cool.
|
Lumy
Minmatar eXceed Inc. Triumvirate.
|
Posted - 2008.11.04 22:04:00 -
[2]
Check page source code in IGB. I guess reply doesn't render because you're missing <html></html> tags.
Joomla! in EVE - IGB compatible CMS. |
Saai Einjhar
|
Posted - 2008.11.04 22:24:00 -
[3]
You were right about the </html> tag, thats for sure... but its not fixing the problem. I've even added, ob_start(); ob_end_flush(); in what I believe are the appropriate places now (related to trust of site, even if thats not what I'm interested with lol).
|
Johnathan Roark
Caldari Quantum Industries RAZOR Alliance
|
Posted - 2008.11.04 23:23:00 -
[4]
<?php $Fname = $_POST["Fname"]; $Lname = $_POST["Lname"]; $gender = $_POST["gender"]; $food = $_POST["food"]; $quote = $_POST["quote"]; $education = $_POST["education"]; $TofD = $_POST["TofD"]; if (!isset($_POST['submit'])) { // if page is not submitted to itself echo the form ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="generator" content= "HTML Tidy for Windows (vers 14 February 2006), see www.w3.org" /> <title>Personal INFO</title> </head> <body> <form method="post">">First Name:<input type="text" size= "12" maxlength="12" name="Fname" /><br /> Last Name:<input type="text" size="12" maxlength="36" name= "Lname" /><br /> Gender:<br /> Male:<input type="radio" value="Male" name="gender" /><br /> Female:<input type="radio" value="Female" name="gender" /><br /> Please choose type of residence:<br /> Steak:<input type="checkbox" value="Steak" name="food[]" /><br /> Pizza:<input type="checkbox" value="Pizza" name="food[]" /><br /> Chicken:<input type="checkbox" value="Chicken" name= "food[]" /><br /> <textarea rows="5" cols="20" name="quote" wrap="physical"> Enter your favorite quote! </textarea> <br /> Select a Level of Education:<br /> <select name="education"> <option value="Jr.High">Jr.High</option> <option value="HighSchool">HighSchool</option> <option value="College">College</option> </select><br /> Select your favorite time of day:<br /> <select name="TofD"> <option value="Morning">Morning</option> <option value="Day">Day</option> <option value="Night">Night</option> </select><br /> <input type="submit" value="submit" name="submit" /> </form> </body> </html> <? } else { echo "Hello, ".$Fname." ".$Lname.".<br>"; echo "You are ".$gender.", and you like "; foreach ($food as $f) { echo $f."<br>"; } echo "<i>".$quote."</i><br>"; echo "You're favorite time is ".$TofD.", and you passed ".$education."!<br>"; } ?> [/code]
Few things I noticed. The first was the submit wasn't displaying for me, I'm guessing it was an HTML thing, eve browser is picky and tends to drop things if you have incorrect HTML. So I ran the output through HTML tidy. That fixed that.
Other thing I noticed was the action in was blank when viewed <form method="post" action=" ">[/code]. I tried messing with the PHP_SELF, then gave up, its not needed, just remove the action attribute all together. It will assume self if no action is set. |
Johnathan Roark
Caldari Quantum Industries RAZOR Alliance
|
Posted - 2008.11.04 23:31:00 -
[5]
[code] br < ?php br $Fname = $_POST[ Fname; $Lname = $_POST["LnamePOS-Tracker 2.1.0 Hosting |
Johnathan Roark
Caldari Quantum Industries RAZOR Alliance
|
Posted - 2008.11.04 23:33:00 -
[6]
Stupid Eve forms not parsing correctly.
Few things I noticed. The first was the submit wasn't displaying for me, I'm guessing it was an HTML thing, eve browser is picky and tends to drop things if you have incorrect HTML. So I ran the output through HTML tidy. That fixed that. Other thing I noticed was the action in was blank when viewed. I tried messing with the PHP_SELF, then gave up, its not needed, just remove the action attribute all together. It will assume self if no action is set.
POS-Tracker 2.1.0 Hosting |
Johnathan Roark
Caldari Quantum Industries RAZOR Alliance
|
Posted - 2008.11.04 23:33:00 -
[7]
<?php $Fname = $_POST["Fname"]; $Lname = $_POST["Lname"]; $gender = $_POST["gender"]; $food = $_POST["food"]; $quote = $_POST["quote"]; $education = $_POST["education"]; $TofD = $_POST["TofD"]; if (!isset($_POST['submit'])) { // if page is not submitted to itself echo the form ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="generator" content= "HTML Tidy for Windows (vers 14 February 2006), see www.w3.org" /> <title>Personal INFO</title> </head> <body> <form method="post">First Name:<input type="text" size= "12" maxlength="12" name="Fname" /><br /> Last Name:<input type="text" size="12" maxlength="36" name= "Lname" /><br /> Gender:<br /> Male:<input type="radio" value="Male" name="gender" /><br /> Female:<input type="radio" value="Female" name="gender" /><br /> Please choose type of residence:<br /> Steak:<input type="checkbox" value="Steak" name="food[]" /><br /> Pizza:<input type="checkbox" value="Pizza" name="food[]" /><br /> Chicken:<input type="checkbox" value="Chicken" name= "food[]" /><br /> <textarea rows="5" cols="20" name="quote" wrap="physical"> Enter your favorite quote! </textarea> <br /> Select a Level of Education:<br /> <select name="education"> <option value="Jr.High">Jr.High</option> <option value="HighSchool">HighSchool</option> <option value="College">College</option> </select><br /> Select your favorite time of day:<br /> <select name="TofD"> <option value="Morning">Morning</option> <option value="Day">Day</option> <option value="Night">Night</option> </select><br /> <input type="submit" value="submit" name="submit" /> </form> </body> </html> <? } else { echo "Hello, ".$Fname." ".$Lname.".<br>"; echo "You are ".$gender.", and you like "; foreach ($food as $f) { echo $f."<br>"; } echo "<i>".$quote."</i><br>"; echo "You're favorite time is ".$TofD.", and you passed ".$education."!<br>"; } ?>
POS-Tracker 2.1.0 Hosting |
Saai Einjhar
|
Posted - 2008.11.05 00:18:00 -
[8]
tks mate, could have used that insight a few hours ago. I finally got it working , my script looks very similar to yours, except I have my echos at the top purely for ease of location and editing during my attemptes.. tks again...
Quote: <html> <body> <?php $Fname = $_POST["Fname"]; $Lname = $_POST["Lname"]; $gender = $_POST["gender"]; $food = $_POST["food"]; $quote = $_POST["quote"]; $education = $_POST["education"]; $TofD = $_POST["TofD"];
if(array_key_exists('Fname', $_POST)) { echo "Hello, ".$Fname." ".$Lname.".<br />"; echo "You are ".$gender.", and you like "; foreach ($food as $f) echo $f."<br />"; echo "Your favorite Quite today is: <i>".$quote."</i><br />"; echo "You're favorite time of the day is ".$TofD.", and I hear you passed ".$education."!<br />"; } else { ?>
<title>Personal INFO</title> </head> <body>
<form method="post" action="formexample.php"> <p> First Name:<input type="text" size="12" maxlength="12" name="Fname">:<br> Last Name:<input type="text" size="12" maxlength="36" name="Lname">:<br> Gender:<br> Male:<input type="radio" value="Male" name="gender"><br /> Female:<input type="radio" value="Female" name="gender"><br /> Please choose type of residence:<br /> Steak:<input type="checkbox" value="Steak" name="food[]"><br /> Pizza:<input type="checkbox" value="Pizza" name="food[]"><br /> Chicken:<input type="checkbox" value="Chicken" name="food[]"><br /> <textarea rows="5" cols="20" name="quote" wrap="physical">Enter your favorite quote!</textarea><br /> Select a Level of Education:<br /> <select name="education"> <option value="Jr.High">Jr.High</option> <option value="HighSchool">HighSchool</option> <option value="College">College</option></select><br /> Select your favorite time of day:<br /> <select name="TofD" size="3"> <option value="Morning">Morning</option> <option value="Day">Day</option> <option value="Night">Night</option></select><br />
<input type="submit" value="submit" name="submit">
<br> </form> <?php } ?> </body> </html>
|
Johnathan Roark
Caldari Quantum Industries RAZOR Alliance
|
Posted - 2008.11.05 00:49:00 -
[9]
Edited by: Johnathan Roark on 05/11/2008 00:49:57 no problem, figuring out the quarks in the ingame browser is something that takes a bit.
Figures, now my previous post are rendering correctly
Edit: no they aren't, log out, they are fine, log in, they break. |
|
|
|
Pages: [1] :: one page |
First page | Previous page | Next page | Last page |