PHP file outputting symbols..?
-
I was coding, using AJAX and PHP. Basically the PHP echoes a word back to the page after trying to sign in. I noticed it wasn't working, so I made the word echo back out in a js alert box. It echoed lots of random symbols. I triple checked my code and it didn't reveal anything. So I backed all the code up, and started deleting bits that may cause it. Eventually there's nothing left except "<?php ?>". And it's still outputting symbols. If it helps, my original code was $username = $_POST['username']; $password = $_POST['password']; $password = md5($password); include "connect.php"; $query = mysql_query("SELECT * FROM members WHERE username='$username'") or die("aw"); $row = mysql_fetch_array($query); $ppassword = $row['password']; if(mysql_num_rows($query) == 0){ echo "no account"; }else if($password == $ppassword){ echo "success"; }else{ echo "wrong password"; } and it's echoing: Lo—ˆ— % %on I'm more stumped than angry to be honest xD Anyone shed some light on the situation?
-
Answer:
There is nothing "wrong" in the code you pasted, except a little incorrect syntax in your query, but mysql is quite forgiving... The error is elsewhere! LOL... You say "AJAX": I see no AJAX in that code either. It looks more like a php code that reads and deals with a form that has been previously posted.
Jacob Morris at Yahoo! Answers Visit the source
Related Q & A:
- How to parse .log file and insert into database in PHP?Best solution by unix.com
- How to upload a file to another server using cURL and PHP?Best solution by Stack Overflow
- How convert .txt file to .Dat file in php?Best solution by Stack Overflow
- How to use external PHP file in СakePHP 2?Best solution by Stack Overflow
- How to connect php file to ms access?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.