Wrox Programmer Forums
|
BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5
This is the forum to discuss the Wrox book Beginning PHP4 by Wankyu Choi, Allan Kent, Chris Lea, Ganesh Prasad, Chris Ullman; ISBN: 9780764543647
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 28th, 2007, 11:36 AM
Registered User
 
Join Date: Sep 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch 11 creating a user reg script

Hi all,:)
Hope someone will reply!!
I am having problem with this code,please help me-
[code]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php
//register.php
include_once "./common_db.inc";
function in_use($userid)
{
global $user_tablename;
$query="SELECT userid FROM $user_tablename WHERE userid='$userid'";
$result=mysql_query($query);
if(!mysql_num_rows($result)){
return 0;
}else{
return 1;
}
}
function register_form()
{
global $userposition;
global $PHP_SELF;
$link_id=db_connect();
$link_id=db_connect();
mysql_select_db("sample_db");
$position_array=enum_options('userposition',$link_ id);
mysql_close($link_id);
?>
<center><h3>Create your account!</h3></center>
<form method="post" action="<?php echo $PHP_SELF ?>">
<input type="hidden" name="action">
<div align="center"><center><table border="1" width="90%">
<tr>
<th width="30%" nowrap>Desired ID</th>
<td width="70%"><input type="text" name="userid" size=8"></td>
</tr>
<tr>
<th width="30%" nowrap>Desired Password</th>
<td WIDTH="70%"><input type="password" name="userpassword2" size="15"></td>
</tr>
<tr>
<th width="30%" nowrap>Full Name</th>
<td width="70%"><input type="text" name="username" size="20"></td>
</tr>
<tr>
<td width="30%" nowrap>Position</th>
<td width="70%"><select name="userposition" size="1">
<?php

?>
for($i=0;$i<count($position_array);$i++){
if(!isset($userposition) && $i==0){
echo "<OPTION SELECTED VALUE=\"".$position_array[$i]."\">".$position_array[$i]."</OPTION>\n";
}else if($userposition==$cposition_array[$i]){
echo "<OPTION SELECTED VALUE=\"".$position_array[$i]."\">".
$position_array[$i]."</td>OPTION>\n";
}
}
?>
</select></td>
</tr>
<tr>
<th width="30%" nowrap>Email</th>th>
<td width="70%"><input type="text" name="useremail" size="20"
</td>
</tr>
<tr>
<th width="30%" nowrap>Profile</th>th>
<td WIDTH="70%"><textarea rows="5" cols="40" name="userprofile">





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch.14 Creating Windows Form User Controls problem SAIFI BOOK: Beginning Microsoft Visual Basic 2008 ISBN: 978-0-470-19134-7 1 September 29th, 2008 05:51 AM
Ch 11 Pg459 Exercise 5 C# brivad BOOK: Beginning ASP.NET 1.0 0 September 10th, 2007 08:59 AM
Need an ASP script for Member reg. & Logon CSUjr Classic ASP Basics 1 October 16th, 2006 08:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.