Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Bug In View Article 1

Status
Not open for further replies.

d3sol4t3

Programmer
Oct 27, 2005
40
GB
Hi

I've got a little bug in my site which is damn hard to fix.


^^ Go there first

As you can see it's a news website, click any headline you like (say the 'Bug Needs Fixing' headline).

In your browser it looks like this:


Replace anything after the '=' to whatever you want, say

sdf sd f

and hit enter in your browser.

As you can see it prints anything after the '=' onto the screen :\ .

How can i fix this? Source code posted below:

<== source code to main.php

<=== source code to view_article.php.


Thank You.
 
Right, I think I have magic_quotes_GPC enabled, thats whats causing the problem. Any other alternative to prevent SQL injection with magic quotes turned on?
 
ok nm, debugged my code line by line and found that this line:

$res=mysql_query($qry) or die(mysql_error());

should be changed to this:

$res=mysql_query($query) or die(mysql_error());
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top