Jump to content
xisto Community
Sign in to follow this  
Soviet Rathe

Put Lockerz Invite Form On Your Website

Recommended Posts

Ok here's a simple script that allows visitors to input their email address in a form and it will be emailed to you and you can send them their invite =]
This requires a server that supports PHP

First make an invite.php file and insert the following code:

<form name="lockerz" method="post" action="lockerz.php"><label>Input Your Email Address To Receive Your FREE Lockerz Invite! <input name="email" type="text" id="email"></label><label><input type="submit" name="Submit" value="Submit"></label></form>
This is the code for your form, you can eather put it in the invite.php or you can put it in any page just so long as it is in .php format.

Ok let's look at this bit of code from the code above:
action="lockerz.php"
You need to create a lockerz.php file. this cannot be on another page of your site. it needs to be it's own file.

in the lockerz.php file input the following code:
<?php  $email = $_REQUEST['email'];  $message=$_REQUEST['email'];  mail( "YOUR-EMAIL", "LOCKERZ",	$message, "From: $email" );  header( "Location: THANK-YOU-PAGE" );?>
Ok let's break down that code.
mail( "YOUR-EMAIL", "LOCKERZ",
In this bit, change the "YOUR-EMAIL" to your email address being sure to keep the quotes in there.
You can also edit the "LOCKERZ" bit to what you want. this is just the email subject you will see when receiving the email.

Ok now let's look at this bit of code:
header( "Location: THANK-YOU-PAGE" );
Change the "THANK-YOU-PAGE" to the URL of the thank you page that users will see upon pressing the submit button. this can be in any format.

You now have a fully working Lockerz invite form :P any questions post here

Share this post


Link to post
Share on other sites

If you use $_REQUEST you have no guarantee that the data came from the post data, which leads to security holes in your script. It's better to use $_POST when you can. I would also avoid $_GET.And this form/script tutorial is not special or specific to Lockerz... this is a standard PHP form submit. What's the difference?

Share this post


Link to post
Share on other sites

And this form/script tutorial is not special or specific to Lockerz... this is a standard PHP form submit. What's the difference?

none. but alot of people want this specifically for Lockerz so I thought this would be useful

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.