be sure to turn on your error handling


you can also try


be sure to include:


at the top of your page to ensure error reporting is turned on.

also, i notice in your HTML for the Phone Number and E-Mail Address that the input boxes are not closed.

      <tr> <td>Phone Number:</td>
        <td align="right"> <input type="text" name="phoneNumber"</td></tr>
        <tr> <td>Address:</td>
        <td align="right"> <input type="text" name="address"</td></tr>

should be

<tr> <td>Phone Number:</td>
<td align="right"> <input type="text" name="phoneNumber"></td></tr>
<tr> <td>Address:</td>
<td align="right"> <input type="text" name="address"></td></tr>

i hate people who copy/paste code, and when it doesn't work, post it to a forum instead of trying to solve it yourself.

to View usernames
$result = mysql_query("SELECT * FROM users");
while($r = mysql_fetch_array($result)) {
echo "$r['full_name']<br>";
echo "$r['username']<br>";
echo "$r['password']<br>";

You did not provide your MySQL structure, so those values may be different.

As for changing a password, you'll need to setup an Edit page, and you'll be using MySQL's UPDATE function. Google it.

Pretty sure you need single quotes wrapped around all of your INSERT Values.

@ardav he never marked it as "Solved", so I figure the person was too lazy to solve your riddle. Stupid semi-colons!

you forgot a semi-colon on line 2

Your forms action is set to Login.php, which is the form page. All and all this looks really mixed up. Set the action to loginhome.php.

You can access WAMPP by going to [url]http://localhost[/url] in your web browser. This will give you all the basic information on your WAMPP install.

A basic PHP MySQL connection looks like this:

// config.php //

A basic MySQL query is:

$sql = "SELECT * FROM table_name";
$result = mysql_query($sql);

Generally speaking, you have a LOT of reading and learning to do. Spend more time doing that then making forum posts, the only way to figure this stuff out is to try it yourself.

We recently moved over to a IIS server (from Linux....don't ask me why), and it was a server problem. I re-installed FastCGI and set my php.ini back to default and went through the settings again.

Stupid IIS. Thank you pritaeas for making the gears in my head move =)

It never gets to the query. It's as if the request overflows, and sputters into a 404 page.

I cannot echo/print out my query. When the page does 404 Error, this is an example of a URL:


My post_max_size is already set to 80m. I'm not uploading a file, just running a mysql UPDATE query with a large amount of text. Once the text hits a certain limit, the form submission goes to a 404 page.

New tenants with little to no "notes" never have this problem. The issue only occurs with tenants with a large amount of notes that are being added onto.

My program is a simple client database that holds information on tenants. Each tenant has a LONGBLOB column called 'notes' to hold updated information on them.

For tenants that have a long list of notes, when the form is submitted the site actually goes to a 404, so their profile never gets updated.

Is there a HTTP limit to POST/GET characters that can be sent? I cannot figure out if this problem is being caused by PHP or IIS, as this has never happened before.

Any help is appreciated, sorry if my explanation is bad.

Read over your table structure again, so yes, comment_id will be your page_id, but since the names are a little confusing I'd change it from comment_id to page_id.

You're database table would just include an extra column called 'type' to designate if they were a Doctor, Nurse, etc....

I agree with ardav, a simple login script will do just fine. Upon the sql query include a check for their 'type' and you're set.

I am working off of an old project, and instead of having to re-write the entire system, I am making edits to the current one.

Generally I tend to store all date values as unix timestamps (strtotime) and never use MySQL's Date Time format.

Problem solved:
$sql = "SELECT * FROM timeclock WHERE user = 'mdloring' AND punch_in BETWEEN '26-12-2011' AND '9-01-2012' ORDER BY punch_in DESC";

By simply removing the leading 0 from 09, the query worked just fine. Wahoo!

Please post your PHP code so we can lead you in the right direction.

Undefined index errors normally come from variables being called for but don't necessarily exist yet.

I edited your code:
$drinks = $_POST['drink']; //here is your error, change to:
if(isset($_POST['drink'])) {
$drinks = $_POST['drink'];
$drink1 = $drinks[0];
$drink2 = $drinks[1];

if(isset($_POST['first_name'])) { $first_name = $_POST['first_name']; }

} else {
$first_name = "unknown";
echo $first_name;

Hope this clears things up for you.

inni2626 commented: thanks +1

I'm having some trouble collecting data between 2 different years (ie: December 2011 & January 2012).

This is a timeclock system where punches are stored as: DD-MM-YYYY (31-12-2011).

I want to be able to search for dates between: DD-MM-2011 through DD-MM-2012 but am coming up empty. When using the same year the query works just fine. Here is my failed code:

$sql = "SELECT * FROM timeclock WHERE user = 'mdloring' AND punch_in BETWEEN '26-12-2011' AND '09-01-2012' ORDER BY punch_in DESC";

There are no MySQL errors, so I think it has something to do with the way I store my dates. I know that MySQL's default date storage is YYYY-MM-DD but I rarely use that.

Any help is greatly appreciated.

Please post some code so that users can help guide you. Don't expect anyone here to do your job for you =)

If you can pick up PHP or Java, you can learn HTML in a matter of hours. Today is not about knowing 1 language, but being comfortable with multiple ones.

I'm 25 with a History degree and make just under 100k programming PHP/MySQL/HTML/CSS and a little Java/AJAX/jQuery. No stupid Comp Sci degree, no certifications.

Money wise, learn .NET/ASP and you will seriously bank. Understand the ins and outs of programming with Microsoft's Sharepoint is highly lucrative.

[QUOTE=bo0ga;1719497]Thanks for the replies. Another quick question. Is PHP necessary if a person is to use a content management system such as Wordpress/Joomla? I kind of see HTML unncessary to learn for example since programs generate the HTML for you .. can the same be said for PHP?[/QUOTE]

Page with the form:
<form action='data_page.php' method='post'>
Username: <input type='text' name='user'><BR>
Password: <input type='password' name='pass'><BR>
<input type='submit' value='Login'>

Page that accepts the form data:
$user = $_POST['user'];
$pass = $_POST['pass'];

if ($user == "Enter" && $pass == "12345"){
echo "Access Granted";
echo "Access Denied";

You don't need to use a SESSION unless you are using multiple "member only" pages (correct me if I'm wrong please). In general though, using SESSIONS is a good idea for obvious security reasons.

First off, welcome to the utterly miserable world of the Windows Server Environment.

I struggled with this same exact issue, and spoke to one of my Networking guys here at work. It ended up being an issue with the ACL, and our Network guy had to add an exception on the network to allow SMTP emails to be sent from a web site.

For me it wasn't a programming issue, but instead a Networking/Server Admin problem. Talk to those guys in your office and you should be fine. Your code looks good to me, but normally Auth issues are networking problems (unless your credentials are a bad username/pw).

Good Luck!


you'll need to format the text before you input it into your db, which can be done in a few different ways:

if(isset($_POST['textarea'])) {
$textarea = mysql_real_escape_string($_POST['textarea']);


if(isset($_POST['textarea'])) {
$textarea = addslashes($_POST['textarea']);

Depending on how secure you need to be. Complete the MySQL INSERT the way you normally would. Hope this helps.

the exact same thread 3 times in a row? ::cough:: ban ::cough::

they probably used a mysql injection. clean up your php code. those guys aren't hackers, they're little script kiddies who manipulated your code. they didn't brute force their way in.

your site was hacked because of your own code.

Not sure if this is a PHP problem or IIS7 issue:

My form is used for editing client information, and it has worked flawlessly for the last year until now. Some clients have more "Notes" about their file than others, and recently clients with a lot of "Notes" have been causing 404 Errors when trying to update their file.

I've already set my post_max_size to 50M, and my memory_limit is set to 128M.

My "Notes" column is set to BLOB (I've tried VarChar, Text, LongText, etc...), but to no avail.

BLOB columns don't have a max size, so I do not think this is a MySQL issue. There is no MySQL error displayed, instead, on form submission the page simply goes to a 404 "The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable."

This is running off of my own IIS7 Windows 2008 machine, which leads me to believe that there may be some server configuration that needs to be done. Any help is greatly appreciated.


Very easy to do. What's funny is that sending a text message is no different then sending an email. Though depending on the provider the "address" changes a bit, but this tutorial will give you all the information you need!

David Walsh's SMS with PHP - [url][/url]

Like I said before, what does your genre.php code look like? Not exactly sure what the "problem" you're having is anymore.

What does your genre.php code look like? Instead of ID, you can search by name... (SELECT * FROM games WHERE genre = '$genre_name')

My above code will store the genre as the genre name (not the genre id) in your games table.

My comments are in the code. Hope this helps!


$d = date("d");
$m = date("m");
$y = date("Y");
$Xdate = "$d/$m/$y";

$name = addslashes($_POST['name']);
$poster = addslashes($_POST['poster']);
$genre = addslashes($_POST['genre']);
$console = addslashes($_POST['console']);
$company = addslashes($_POST['company']);
$oldprice = addslashes($_POST['oldprice']);
$newprice = addslashes($_POST['newprice']);
$status = addslashes($_POST['status']);
$copies = addslashes($_POST['copies']);
$details = addslashes($_POST['details']);
$video = addslashes($_POST['video']);
$link = addslashes($_POST['link']);
$rate = addslashes($_POST['rate']);

   //find the name of the genre
      $sql = "SELECT name FROM genre WHERE id = '$genre'";
       $result = mysql_query($sql);
         while($genre_name = mysql_fetch_array($result)) {
            $genre = $genre_name['name'];
        //the above code should produce the genre name based off the id

if ($name == ""){
echo "<div align='center'>You Must Fill All Fields<a href='javascript:history.back(1)'>( Back )</a></div>";
$query = @mysql_query ("INSERT INTO games (name,poster,genre,console,company,oldprice,newprice,status,copies,details,video,link,rate,date) VALUES ('$name','$poster','$genre','$console','$company','$oldprice','$newprice','$status','$copies','$details','$video','$link','$rate','$Xdate')") or die ("Error");
echo "<p align=center>Game Added ..</p>";
echo "<META HTTP-EQUIV='refresh' CONTENT='1; URL=Game_Add.php'>";