I have error i have web site where want to users register this is code from index.php :
<?php
include ('include/header.php');
if (isset($_GET['id'])){
switch ($_GET['id'])
{
case "wallpaper":
include ("include/wallpaper.php");
break;
case "ringtones":
include ("include/ringtones.php");
break;
case "themes":
include ("include/themes.php");
break;
case "apps":
include ("include/apps.php");
break;
case "aboutus":
include ("include/aboutus.php");
break;
case "fannystuff":
include ("include/fannystuff.php");
break;
case "register":
include ("include/register.php");
break;
case "users":
include ("include/users.php");
break;
}
} else {
include ('include/content.php');
include ('include/sidebar.php');
}
include ('include/footer.php');
?>
But in register.php i have this error Notice: Undefined index: username in C:\wamp\www\Androidiks\include\register.php on line 3,4,5
This is code in register.php:
<?php
$submit = $_POST['submit'];
$username = $_POST['username'];
$password = $_POST['pasword'];
$repeatpassword = $_POST['repeatpassword'];
$email = $_POST['email'];
if($submit)
{
echo "$username/$password/$repeatpassword/$email";
}
?>
<div id="registration">
<h2>Create an Account</h2>
<form id="RegisterUserForm" action="register.php" method='POST'>
<fieldset>
<p>
<label for="name">Username</label>
<input id="name" name="username" type="text" class="text" value="" />
</p>
<p>
<label for="password">Password</label>
<input id="password" name="password" class="text" type="password" />
</p>
<p>
<label for="password">Repeat password</label>
<input id="password" name="repeatpassword" class="text" type="password" />
</p>
<p>
<label for="email">Email</label>
<input id="email" name="email" type="email" class="text" value="" />
</p>
<p>
<button id="registerNew" type="submit" name="submit">Register</button>
</p>
</fieldset>
</form>
</div>
PLEASE HELP!
gogs85
0
Junior Poster in Training
Recommended Answers
Jump to PostInstead of following code
<?php $submit = $_POST['submit']; $username = $_POST['username']; $password = $_POST['pasword']; // <---wrong, s missing!!! $repeatpassword = $_POST['repeatpassword']; $email = $_POST['email']; if($submit) { echo "$username/$password/$repeatpassword/$email"; } ?>
check submitting like this, for example:
<?php if(isset($_POST['submit'])) { $username = $_POST['username']; $password …
Jump to PostAre you sure that your form and your register.php file are in the same directory. If you are having this error
When in form action="register.php" then i have problem that this page can't find on server
It simply means you are trying to post to a file that is not …
Jump to PostHi,
jUst to help you out on how to handle those switches gracefully. Just to let everybody know that there is nothing wrong with php switch function. However, in medium to large applications, it will become time consuming to write cases if hundreds of pages are involved. MVC framework design …
Jump to PostHi,
Here is a sample script that can be easily modified to your needs.. Again, you need to test this several times and MUST provide the sufficient security measures for the form processor method get_formData(&$formVars)
First, create a new php file called Simple_Class.class.php and and paste codes below to this …
Jump to PostLarry Singleton will really hate me by getting away without the use or foreach loop :) :).. It is all about strategy Larry lol .....
All 18 Replies
_neo_
16
Junior Poster in Training
gogs85
0
Junior Poster in Training
skliz
0
Unverified User
veedeoo
474
Junior Poster
Featured Poster
gogs85
0
Junior Poster in Training
gogs85
0
Junior Poster in Training
gogs85
0
Junior Poster in Training
veedeoo
474
Junior Poster
Featured Poster
veedeoo
474
Junior Poster
Featured Poster
masterjiraya
-3
Junior Poster
Geffory
0
Newbie Poster
masterjiraya
-3
Junior Poster
Geffory
0
Newbie Poster
gogs85
0
Junior Poster in Training
gogs85
0
Junior Poster in Training
gogs85
0
Junior Poster in Training
gogs85
0
Junior Poster in Training
gogs85
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.