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("Locatio n: regFail1.html") ;
//die('You did not complete all of the required fields<a href=addSupp.ht ml>BACK</a>');
}
// checks if the username is in use
if (!get_magic_quo tes_gpc()) {
$_POST['username'] = addslashes($_PO ST['username']);
}
$usercheck = $_POST['username'];
$check = mysql_query("SE LECT 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.ht ml>BACK</a>');
}
$_POST['password'] = md5($_POST['password']);
if (!get_magic_quo tes_gpc()) {
$_POST['password'] = addslashes($_PO ST['password']);
$_POST['username'] = addslashes($_PO ST['username']);
}
$insert = "INSERT INTO users (username,passw ord,status,name ,surname,compan y,tele,fax,Supp Name,bussAddr,t ype,desciption, cnt_person,emai l,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($in sert);
header("Locatio n: regSuccess.html ");
?>
<?php
}
?>
<?php
HTML Script::::
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Procurem ent Tracking System</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="adSuppl ier.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">Regist er New Supplier</font></strong>
<p></p>
<div align="center">
<table width="544" border="1" bordercolor="#0 00000" bgcolor="#A6A65 3" class="text">
<table width="544" border="1" bordercolor="#0 00000" bgcolor="#A6A65 3" class="text">
<tr>
<td colspan="2"><st rong>FILL IN ALL DETAILS</strong></td>
</tr>
<tr>
<td width="183" valign="top" ><font face="Verdana" size="2">Userna me:</font></td>
<td width="345"><in put type="text" name="username" maxlength="60"> </td>
</tr>
<tr>
<td height="20" valign="top"><f ont face="Verdana" size="2">Passwo rd:</font></td>
<td valign="top"><i nput type="password" name="password" maxlength="60"> </strong></td>
</tr>
<tr>
<td height="20" valign="top"><s trong><font face="Verdana" size="2">Status :
1=Supplier</font></strong></td>
<td valign="top"><s trong><input type="text" name="status" maxlength="60"> </strong></td>
</tr><strong>
<tr>
<td height="20" valign="top"><f ont face="Verdana" size="2">Name:</font></td>
<td valign="top"><i nput type="text" name="name" maxlength="60"> </td>
</tr>
<tr>
<td height="20" valign="top"><f ont face="Verdana" size="2">Surnam e:</font></td>
<td valign="top"><i nput type="text" name="surname" maxlength="10"> </td>
</tr>
<tr>
<td height="20" valign="top"><f ont face="Verdana" size="2">Compan y::</font></td>
<td valign="top"><i nput type="text" name="company" maxlength="10"> </td>
</tr>
<tr>
<td height="20" valign="top"><f ont face="Verdana" size="2">Teleph one Number::</font></td>
<td valign="top"><i nput type="text" name="tele" maxlength="10"> </td>
</tr>
<tr>
<td height="20" valign="top"><f ont face="Verdana" size="2">Fax Number::</font></td>
<td valign="top"><i nput type="text" name="fax" maxlength="10"> </td>
</tr>
</strong>
<tr>
<td height="20" valign="top"><s trong><font face="Verdana" size="2">Suppli er
Name :</font></strong></td>
<td valign="top"><s trong><input type="text" name="SuppName" maxlength="60"> </strong></td>
</tr><strong>
<tr>
<td height="20" valign="top"><f ont face="Verdana" size="2">Busine ss Address:</font></td>
<td valign="top"><t extarea type="text" name="bus_addr" rows="2" cols="16"></textarea></td>
</tr>
<td height="20" valign="top"><f ont face="Verdana" size="2">Busine ss Type:</font></td>
<td valign="top"><i nput type="text" name="type" maxlength="60"> </td>
</tr>
<tr>
<td height="20" valign="top"><f ont face="Verdana" size="2">Descri ption:</font></td>
<td valign="top"><i nput type="text" name="descr" maxlength="60"> </td>
</tr>
<tr>
<td height="20" valign="top"><f ont face="Verdana" size="2">Contac t Person:</font></td>
<td valign="top"><i nput type="text" name="cnt_perso n" maxlength="60"> </td>
</tr>
<tr>
<td height="20" valign="top"><f ont face="Verdana" size="2">E-mail:</font></td>
<td valign="top"><i nput type="text" name="email" maxlength="60"> </td>
</tr>
<tr>
<td height="20" valign="top"><f ont face="Verdana" size="2">Regist ration Number:</font></td>
<td valign="top"><i nput type="text" name="reg_no" maxlength="60"> </td>
</tr>
<tr>
<td height="20" valign="top"><f ont face="Verdana" size="2">Vat Number:</font></td>
<td valign="top"><i nput type="text" name="vat_no" maxlength="60"> </td>
</tr>
</strong>
</table>
<p></p>
<div align="center">
<input type="submit" name="submit" value="Add">
<input type="Reset" value="Reset" ></div>
<hr color="#000000" >
</form>
</body>
</html>
Thanx In advance
2 1271
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:
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:
Sign in to post your reply or Sign up for a free account.
Similar topics |
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 burns.
Here is the code:
$frank = "burns";
|
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 any preconceived ideas about it. I have
noticed, however, that every programmer I talk to who's aware of Python is
also talking about Ruby. So it seems that Ruby has the potential to compete
with and displace Python. I'm curious on what basis it...
|
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 capabilities, unfortunately. I'd like to know if it may
be possible to add a powerful macro system to Python, while
keeping its amazing syntax, and if it could be possible to
add Pythonistic syntax to Lisp or Scheme, while keeping all
of the...
|
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?
cheers,
reed
|
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 pragmatic
- 3) I usually move forward when I get the gut feeling I am correct
- 4) Most likely because of 1), I usually do not manage to fully explain 3)
when it comes true.
- 5) I have developed for many years (>18) in many different environments,...
| |
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 {
public:
string desc;
|
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 software giant such as Microsoft SQL
Server, Oracle, and Sybase?
Is PostgreSQL reliable enough to be used for high-end commercial
application? Thanks
|
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.
|
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 support IDEs are DreamWeaver 8 and
Zend PHP Studio.
DreamWeaver provides full support for Unicode. However, DreamWeaver is
a web editor rather than a PHP IDE. It only supports basic IntelliSense
(or code completion) and doesn't have anything...
|
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 basically entitled to us to just about
every .Net development tool you can imagine. I cant even begin to mention
them.
To begin with, my background is not that of a programmer, but a systems
engineer and the closest I have come to "programming"...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |