Jump to content

Need Help In Sign Up Form


vsvinit0

Recommended Posts

Hello guys this is string1301 i am new to php and i don't know much about php but just in recent days i have started to learn php as i am new in php but i am good at static web pages design so some time i need to embade a sign up form in my web pages so usually i do it by downloading some online source file of sign up form in php then i just embade it to my web page. But this cause me a lot of trouble as i am not able to modify it freely. This time i thought to do it by my self so i just studied some codes and attached it to my web page but when i run it in my local host i am not able to get the out put just a blank page and the page is showing white not even any error message is showing so i decided to share my problem in this forum

 

 

Here's My PHP code

 

<?php
require_once 'connect.php';
require_once 'functions.php';
require_once 'myfunc.php';
 
require_once 'cifunc.php';
 
$name=$address=$landmark=$pincode=$phone_num=$email=$password=$city=$touchpoint=$error=$success="";
 
if(isset($_POST['yourname']))
$name=correct_input($_POST['yourname']);
if(isset($_POST['address']))
$address=correct_input($_POST['address']);
if(isset($_POST['landmark']))
$landmark=correct_input($_POST['landmark']);
if(isset($_POST['pincode']))
$pincode=correct_input($_POST['pincode']);
if(isset($_POST['phone_num']))
$phone_num=correct_input($_POST['phone_num']);
if(isset($_POST['email']))
$email=correct_input($_POST['email']);
if(isset($_POST['password']))
$password=correct_input($_POST['password']);
$city=$_POST['city'];
$touchpoint=$_POST['touchpoint'];
$fail = validate_name($name);
 
$fail .= validate_landmark($landmark);
 
$fail .= validate_password($password);
 
$fail .= validate_phone($phone_num);
 
$fail .= validate_email($email);
 
$fail .= validate_address($address);
 
if($fail=="")
{
if(isset($_POST['accept']))
{
$name=strtolower($name);
$landmark=strtolower($landmark);
$address=strtolower($address);
$query="INSERT INTO user_info(name,address,landmark,pincode,city,phone_num,hear,email,password) VALUES('$name','$address','$landmark','$pincode','$city','$phone_num','$touchpoint','$email','$password')";
if(queryMysql($query))
{
$success="Successfull Sign up. Please Log in.";
}
else
{
$error="Sign up not successfull. Please Try Again.";
}
}
else
{
$error="Please accept terms and conditions.";
}
}
echo<<<_END
 
 
<html>
<head>
<title>
Sign Upp
</title>
</head>
<body>
<form method="post" action="signupp.php">
<p>$error</p> <p>$success</p>
<table>
 
<tr>
<td>Your name:</td>
<td><input type="text" name="yourname" /></td>
</tr>
 
<tr>
<td>Address:</td>
<td><input type="text" name="address" /></td>
</tr>
 
<tr>
<td>Landmark:</td>
<td><input type="text" name="landmark" /></td>
</tr>
 
<tr>
<td>Pin Code:</td>
<td><input type="text" name="pincode" /></td>
</tr>
 
<tr>
<td>City:</td>  
<td><select name="city">
<option value="Bangalore">Bangalore</option>
</select>
</td>
</tr>
 
<tr>
<td>Your phone number:</td>
<td><input type="text" name="phone_num" /></td>
</tr>
 
<tr>
<td>How did you hear about us?</td> 
<td><select name="touchpoint">
<option value="">Select</option>
<option value="Friends">Friends</option>
<option value="Hoarding">Hoarding</option>
<option value="Newspaper">Newspaper Insert</option>
<option value="Apartment">Apartment Event</option>
<option value="Online">Online Search</option>
<option value="Flyer">Flyer</option>
</select>
</td>
</tr>
 
<tr>
<td>Email:</td>
<td><input type="text" name="email" /></td>
</tr>
 
<tr>
<td>Password:</td>
<td><input type="text" name="password" /></td>
</tr>
 
<tr>
<td><input type="checkbox" name="accept" /> Accept Terms and Conditions</td>
</tr>
 
<tr>
<td><button>Submit</button></td>
</tr>
 
</table>
</form>
</body>
</html>
 
 
 
_END;

?>   

 

 

And i need some tutorial or pdf files or any web site where i can learn this php

I want some one to guide me so that i can go in a proper path to learn php

 

Thanks  

 

 

 

post-166833-0-18488800-1386654911_thumb.jpg

Link to comment
Share on other sites

blank .php pages are usually the result of a fatal php parse error, a fatal php runtime error, or code that simply doesn't output anything.

 

for the first two possibilities, you need to have php's error_reporting set to E_ALL and display_errors set to ON in the php.ini on your development system to get php to report and display all the errors it detects.

 

for the last possibility, deliberately echo some test string in your php code, outside of any conditional logic statement, to see if it is displayed.

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.