Jump to content

Making a register script from an Image


simonttz

Recommended Posts

Ok, so my business partner and I are making a website. He sends me an image and tells me to turn the exact image into a register script.  I know some PHP codes such as tying the input fields into the sql database but I need to learn how to PHP code in a more advanced fashion. Of course I have google'd "Custom php register script" and other assemblies of keywords but I seem unable to get the results I desire.. I want specifically to learn how to make different functions such as male/female features that come with the Members Area.  If anyone out there can give me some insight on how to do so it would be very helpful  :)

 

I have viewed Tutorials like this :

But I want to know how to add features like 'choose your own password' & Gender features

 

Here is the Image My partner sent me: http://i50.tinypic.com/30kr4zo.jpg

 

[attachment deleted by admin]

Link to comment
Share on other sites

I'm not sure anyone is going to write a personalized tutorial for you. All I can really suggest is that you need to learn to think each individual component through.

 

I want specifically to learn how to make different functions such as male/female features that come with the Members Area.

 

I'm not sure exactly what you mean by this, but I'll assume you mean you want your users to be able to select 9and inform you) what gender they are.

 

To do so, you'll need to break down that problem. eg;

 

How will I ask the user for such data?

How will I then store such data?

 

Once you break your problems into smaller pieces things become less overwhelming. People shouldn't ask, how do I build a forum?, but, what functionality do I need to develop to result in a forum?

Link to comment
Share on other sites

The features you are looking to make are not to do with php but more to do with html, You need to understand how Html forms work and how you can use php to manipulate the data,

 

The following Example will hopefully help,

 

<?php
//Get the values Passed by the html form
$fname = $_POST['fname'];$lname = $_POST['lname'];$email = $_POST['email'];$gender = $_POST['gender'];
$uname = $_POST['uname'];$upass = $_POST['upass'];$about = $_POST['about'];$website = $_POST['website'];
$mode = $_POST['mode'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
if(!$mode){ //No mode was set we can assume they want to submit it, Lets show the form
?>
<form id="form1" name="form1" method="post" action="">
  <p>
    <label for="fname">First Name:</label>
    <input type="text" name="fname" id="fname" />
  </p>
  <p>
    <label for="lname">Last Name:</label>
    <input type="text" name="lname" id="lname" />
  </p>
  <p>
    <label for="email">Email Address:</label>
    <input type="text" name="email" id="email" />
  </p>
  <p>
    Gender: 
    <input type="radio" name="gender" id="gender" value="male" />
    <label for="gender">Male</label>
  
    <input type="radio" name="gender" id="gender" value="female" />
    <label for="gender">Female</label>
  </p>
  <p>
    <label for="uname">Username:</label>
    <input type="text" name="uname" id="uname" />
</p>
  <p>
    <label for="upass">Password:</label>
    <input type="password" name="upass" id="upass" />
</p>
  <p>
    <label for="website">Personal Website:</label>
    <input type="text" name="website" id="website" />
</p>
  <p>
    <label for="about">Tell us a bit about yourself:<br />
    </label>
    <textarea name="about" id="about"></textarea>
  </p>
  <p>
    <label for="register"></label>
    <input type="submit" name="register" id="register" value="Register" />
    <input type="button" name="Cancel" id="Cancel" value="Cancel" />
    <input name="mode" type="hidden" id="mode" value="doreg" />
  </p>
</form>
<?php
}elseif($mode=="doreg"){ //Ok they filled the form in lets process it.
if($fname and $lname and $email and $gender and $uname and $upass and $website and $about){ //Check that all fields where filled (not best way of doing it)
//Right we have all the fields filled and ready, now we can add them to the database
if(mysql_query(%MYSQL QUERY HERE%)){
	echo "Your registration was successful"; //Ok the query was done successfully show the registered message
}else{
	echo "We where unable to register you at this time, Please try again later"; //Oh Dear we couldnt enter the details into the database!
	echo "<br />".mysql_error(); //This will show you why! but do NOT use it on a production server!!
}
}else{
	echo "You failed to supply all fields, Please go back and try again";
}
}else{ //This should only happen if they try to access something which doesnt exist
echo "Unexpected error occured";
}
?>
</body>
</html>

Not exactly the best method but hopefully it's easy enough to understand

 

A little light reading for you,

Html forms

Using html forms with php

 

Stuie

Link to comment
Share on other sites

See my thing is is that I want to paste the code ontop of a picture (input fields) and make the Submit / Cancel buttons the custom ones illustrated in the picture... not the generic ones html brings.

 

That effect could be achieved using css. Formatting the look has nothing to do with php.

Link to comment
Share on other sites

 

 

A little light reading for you,

Html forms

Using html forms with php

 

Stuie

 

Well how do you get it so that when you click register after all your data has been put in you receive an e-mail confirmation AND Activation?

 

Also- How would I make a submit/cancel button  be an image?  which takes the user to a members only area ? codewise?

Link to comment
Share on other sites

Well how do you get it so that when you click register after all your data has been put in you receive an e-mail confirmation AND Activation?

 

I'm not sure your understanding. Do you expect us to write you a personal tutorial? The question you have asked here is covered in MANY already existing tutorials.

 

Your last question has nothing to do with php.

Link to comment
Share on other sites

 

 

A little light reading for you,

Html forms

You can either set the button to an image or use Javascript to submit the form, Try googling submit a form with an image.

 

Stuie

Using html forms with php

 

Stuie

You can either set the button to use an image or use javascript to submit the form, search google for submitting a form with an image

 

Stuie

 

Well how do you get it so that when you click register after all your data has been put in you receive an e-mail confirmation AND Activation?

 

Also- How would I make a submit/cancel button  be an image?  which takes the user to a members only area ? codewise?

Link to comment
Share on other sites

One of your options is to create a table with that image as the background

 

and then positioning input fields and transparent buttons in the area you want them to be in all in a <form> tag

 

lol no body will take the time to do this for you..

 

either you learn it yourself or hire a web designer..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.