feyd | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
so if you only want to echo it to next page ,
heres a simple example that you can look at and see whats goin on .
firts page is straight HTML form ..blah blah
[syntax="html"]
<HTML>
<HEAD></HEAD>
<body>
<center>
<BR><BR>
<form name="something" action="devforum2.php">
First name <BR><input type="text" name="firstname" size="20" value=""><BR><BR>
Last name <BR><input type="text" name="lastname" size="20" value=""><BR><BR>
<BR><BR>
<input type="submit" value="submit">
<br><br>
</form>
</BODY>
</HTML>
Save that as devforum.php
just because thats what i named it for this.
then the second page that all that crap gets shoveled off to.
Name this next one = devforum2.php[/syntax]
Code: Select all
<HTML>
<HEAD>
<?php
//set variable
$first_name = $_REQUEST['firstname'];
$last_name = $_REQUEST['lastname'];
?>
</HEAD>
<body>
<center>
<BR><BR>
<?php echo "Hello" . " " . "$first_name" . " " . "$last_name"; ?>
</BODY>
</HTML>
put them to pages in your www root directory with a server on your computer or upload to web host server.
and whatever you put in the name boxes, hit submit. and it will magically post "hello (first name) (lastname)"
I say magically, because i sprinkled it with magic php dust that can only be found in the ancient mountains somwhere.
I would tell you where , but then little tree gnomes might try to kill you. ..so forget that part.
the stuff with periods and = "$first_name" . " " ."$last_name" etc
thats concatenating. aka= putting all that junk together like a word math function.. to make it echo out together.
feyd | Please use Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]