473,394 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

now what

I used the same code to register onother user officer works fine but the supplier does not work I does says they r registered but when I log in it says the user does not exist.I've looked since monday I give up anyidea what's wrong?????
php script

<?php

// Connects to your Database
mysql_connect("localhost", "root", "phpmysql") or die(mysql_error());
mysql_select_db("procdumy") or die(mysql_error());

//This code runs if the form has been submitted
if (isset($_POST['submit'])) {

//This makes sure they did not leave any fields blank
if ( !$_POST['username'] | !$_POST['password']|!$_POST['name'] |!$_POST['surname'] |!$_POST['company'] |!$_POST['tele'] |
!$_POST['fax'] |!$_POST['SuppName'] | !$_POST['bus_addr']|!$_POST['type'] |!$_POST['descr'] |!$_POST['cnt_person'] |
!$_POST['email'] | !$_POST['reg_no']| !$_POST['vat_no']) {
header("Location: regFail1.html");
//die('You did not complete all of the required fields<a href=addSupp.html>BACK</a>');
}
// checks if the username is in use
if (!get_magic_quotes_gpc()) {
$_POST['username'] = addslashes($_POST['username']);
}
$usercheck = $_POST['username'];
$check = mysql_query("SELECT username FROM users WHERE username = '$usercheck'")
or die(mysql_error());
$check2 = mysql_num_rows($check);
//if the name exists it gives an error
if ($check2 != 0) {
die('Sorry, the username '.$_POST['username'].' is already in use.<a href=addSupp.html>BACK</a>');
}
$_POST['password'] = md5($_POST['password']);
if (!get_magic_quotes_gpc()) {
$_POST['password'] = addslashes($_POST['password']);
$_POST['username'] = addslashes($_POST['username']);
}
$insert = "INSERT INTO users (username,password,status,name,surname,company,tel e,fax,SuppName,bussAddr,type,desciption,cnt_person ,email,regNum,vatNum)
VALUES ('".$_POST['username']."', '".$_POST['password']."', '".$_POST['status']."', '".$_POST['name']."', '".$_POST['surname']."',
'".$_POST['company']."', '".$_POST['tele']."', '".$_POST['fax'].",'".$_POST['SuppName']."', '".$_POST['bus_addr']."',
'".$_POST['type']."', '".$_POST['descr']."',
'".$_POST['cnt_person']."', '".$_POST['email']."', '".$_POST['reg_no']."', '".$_POST['vat_no']."')";
//$add_member = mysql_query($insert);

header("Location: regSuccess.html");
?>

<?php
}
?>

<?php

HTML Script::::

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Procurement Tracking System</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form action="adSupplier.php" method="post">
<table width="100%" border="0">
<tr>
<td><img src="../Procurement/procurement.JPG"></td>
</tr>
</table>

<hr color="#000000">
<strong><font size="6">Register New Supplier</font></strong>
<p></p>
<div align="center">
<table width="544" border="1" bordercolor="#000000" bgcolor="#A6A653" class="text">




<table width="544" border="1" bordercolor="#000000" bgcolor="#A6A653" class="text">

<tr>
<td colspan="2"><strong>FILL IN ALL DETAILS</strong></td>
</tr>
<tr>
<td width="183" valign="top" ><font face="Verdana" size="2">Username:</font></td>

<td width="345"><input type="text" name="username" maxlength="60"></td>
</tr>
<tr>
<td height="20" valign="top"><font face="Verdana" size="2">Password:</font></td>

<td valign="top"><input type="password" name="password" maxlength="60"></strong></td>
</tr>
<tr>
<td height="20" valign="top"><strong><font face="Verdana" size="2">Status:
1=Supplier</font></strong></td>

<td valign="top"><strong><input type="text" name="status" maxlength="60"></strong></td>
</tr><strong>
<tr>
<td height="20" valign="top"><font face="Verdana" size="2">Name:</font></td>

<td valign="top"><input type="text" name="name" maxlength="60"></td>
</tr>

<tr>
<td height="20" valign="top"><font face="Verdana" size="2">Surname:</font></td>

<td valign="top"><input type="text" name="surname" maxlength="10"></td>
</tr>
<tr>
<td height="20" valign="top"><font face="Verdana" size="2">Company::</font></td>

<td valign="top"><input type="text" name="company" maxlength="10"></td>
</tr>
<tr>
<td height="20" valign="top"><font face="Verdana" size="2">Telephone Number::</font></td>

<td valign="top"><input type="text" name="tele" maxlength="10"></td>
</tr>
<tr>
<td height="20" valign="top"><font face="Verdana" size="2">Fax Number::</font></td>

<td valign="top"><input type="text" name="fax" maxlength="10"></td>
</tr>


</strong>


<tr>
<td height="20" valign="top"><strong><font face="Verdana" size="2">Supplier
Name :</font></strong></td>

<td valign="top"><strong><input type="text" name="SuppName" maxlength="60"></strong></td>
</tr><strong>
<tr>
<td height="20" valign="top"><font face="Verdana" size="2">Business Address:</font></td>

<td valign="top"><textarea type="text" name="bus_addr" rows="2" cols="16"></textarea></td>
</tr>

<td height="20" valign="top"><font face="Verdana" size="2">Business Type:</font></td>

<td valign="top"><input type="text" name="type" maxlength="60"></td>
</tr>
<tr>
<td height="20" valign="top"><font face="Verdana" size="2">Description:</font></td>

<td valign="top"><input type="text" name="descr" maxlength="60"></td>
</tr>
<tr>
<td height="20" valign="top"><font face="Verdana" size="2">Contact Person:</font></td>

<td valign="top"><input type="text" name="cnt_person" maxlength="60"></td>
</tr>
<tr>
<td height="20" valign="top"><font face="Verdana" size="2">E-mail:</font></td>

<td valign="top"><input type="text" name="email" maxlength="60"></td>
</tr>
<tr>
<td height="20" valign="top"><font face="Verdana" size="2">Registration Number:</font></td>

<td valign="top"><input type="text" name="reg_no" maxlength="60"></td>
</tr>
<tr>
<td height="20" valign="top"><font face="Verdana" size="2">Vat Number:</font></td>

<td valign="top"><input type="text" name="vat_no" maxlength="60"></td>
</tr>

</strong>
</table>
<p></p>
<div align="center">
<input type="submit" name="submit" value="Add"> &nbsp;&nbsp;
<input type="Reset" value="Reset" ></div>
<hr color="#000000">
</form>


</body>
</html>



Thanx In advance
Sep 21 '06 #1
2 1262
ronverdonk
4,258 Expert 4TB
I hope you made a copy mistake, but you use a bitwise or operator | instead of a logical OR operator || in your IF ($_POST.... ) statement.
Change these single | to double || or the OR.

Ronald :cool:
Sep 21 '06 #2
ronverdonk
4,258 Expert 4TB
And what about the following code:
[php]<?php

HTML Script::::[/php]

Take that out, it is an error and serves no purpose.
You also update the $_POST array in various places. You should take parameters out of the $_POST array and assign them to variables on which you must perform your updates.
And please, next time show your code within code or php tags, because 180 lines is very difficult to rread and does not invite anyone to read it carefully.

Ronald :cool:
Sep 21 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: thecrow | last post by:
Alright, what the hell is going on here? In the following code, I expect the printed result to be: DEBUG: frank's last name is burns. Instead, what I get is: DEBUG: frank's last name is...
220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
92
by: Reed L. O'Brien | last post by:
I see rotor was removed for 2.4 and the docs say use an AES module provided separately... Is there a standard module that works alike or an AES module that works alike but with better encryption?...
137
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very...
12
by: Dario | last post by:
The following simple program behaves differently in Windows and Linux . #include <stdexcept> #include <iostream> #include <string> using namespace std; class LogicError : public logic_error {...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
47
by: Neal | last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A quite good article.
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
8
by: Midnight Java Junkie | last post by:
Dear Colleagues: I feel that the dumbest questions are those that are never asked. I have been given the opportunity to get into .NET. Our organization has a subscription with Microsoft that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.