Change a Sumbit Button using $_GET varibale

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
Domnio





Posts: 199
Joined: Sun Jul 16, 2006 3:44 pm
Location: Earth
Contact:

Change a Sumbit Button using $_GET varibale

Post by Domnio »

Since i'm still learning my friend Wondering Soul wrote out the actual form but I was messing around with it and figured out how to make a submit button say what the $_GET variable is equal to.

Image

in the picture I made it say "@SuBMiT@" by changing the url to say this:

form.php?submit=@SuBMiT@

you can make the button say anything by changing what "form.php?submit" equals and example would be:

form.php?submit=Subm1t

then your button would say "Subm1t"

Code: Select all

<?php

$submit = $_GET['submit'];
$firstname = $_POST['firstname'];
$lastname  = $_POST['lastname'];

echo ( $firstname . " " . $lastname );

?>
<html>
<head>
<title>HTML Forms Example</title>
</head>

<body>
    <!-- We are now starting our form -->
    
        
    <form action="form.php" method="post">
        <!-- Once we have made our form...you need to add inputs to it -->
        <? echo ( "Firts Name" ); ?>
        <br />
        <input type="text" name="firstname">
        <br />
        <? echo ( "Last Name" ); ?>
        <br />
        <input type="text" name="lastname">
        <input type="submit" value="<? echo ( $submit ); ?>">
    </form>
</body>

</html>
RaVNzCRoFT removed my signature because it contained too many lines of text. I'll read the rules next time.
Post Reply