WHAT do you want to make? A completely new file? How is this file gonna be accessed? Does it need to be a complete webpage, ie with a <html> and <head> with linked files, or does it just need to contain a container for content, which then will be pulled via another page? You need to give us a bit more info for us to be able to help. However, doing the basic thing is just plugging the variables from the form/input you have, into a file - look at fwrite() or similar.
i want to show Name, age, about etc.. field on new page when user click on submit button.(php) i created a form with name , age, about, occupation field. now i want show all field on new page. plz help me plz check this link www.howtobe-model.com/create-profile.php . in this i want to show all field data in new page when form has been submitted.
That's not really creating a new page - that's just showing the info from the form on an already created page. Just make the page, call it from the forms action-property, and echo the $_POST variables where you want them.
You can print all form fields in the file you specified in form action Like this: <form action="submit.php"> Code (markup): And in submit.php file you can print this data with following code: <?php foreach($_POST as $k=>$v){ echo $k." = ".$v.'<br/>'; } ?> Code (markup):
Example: <?php if(isset($_POST['submit'])) { if(isset($_POST['address'])) { $address=$_POST['address']; $age=$_POST['age'];}header("location:next.php?address=".$address."&age=".$age);}?> <form name="whatever" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post"> <input name="address" type="text" /> <input name="age" type="text" /> <input type="submit" name="submit" /> </form> Now on the next.php page <p> your address is <b> <?=$_REQUEST['address'];?> </b>
Uhm - that's blatantly wrong. $_POST doesn't automatically get put into $_SESSION - god forbid. Your code doesn't work, at all. Try again. Or, better yet, don't.
Don't mean to be rude, but it's still a little foolish. Why wouldn't you send the data directly via POST to the next page? Constructing a new URL and sending a redirect is not necessary. Plus, $_SERVER['PHP_SELF'] makes the form vulnerable to XSS injections. Just leave the action attribute blank or put the actual file name there.
Hi lalit, First of all, Naming the page and url Name: use a concatenation for ex: I did break it in many chuncks for demo purposes. $begin_url= "<a href=\"index" ; $p=".php"; $end="\">" ; $file_name="myPage"; $a="</a><br>";