I do not want anything like DROP TABLE to work or any type of coding..
Heres my code.. is it secure? if not, please help:
Code: <?php
mysql_connect('','','');
mysql_select_db('cars');
if(preg_match("/^[ a-zA-Z 0-9 &]+/", $_POST['q'])){
$q = $_POST['q'];
$q = addslashes(mysql_real_escape_string($q));
$result = mysql_query("SELECT * FROM parts WHERE MATCH (`category`,`name`,`description`) AGAINST ('$q' IN BOOLEAN MODE)");
$num_results = mysql_num_rows($result);
echo 'Found '.$num_results.' parts matching '.$q.'.';
if($num_results>0) {
$row['name'] = stripslashes(stripslashes($row['name']));
$row['description'] = stripslashes(stripslashes($row['description']));
echo '<p>'.$row['name'].'</a>
<img src="'.$row['thumbnailurl'].'"><br />'.$row['description'].'<br />'.$row['date'].'</p>';
}
}
else {
echo '<p>Their were 0 results for '.$q.'! Try again?</p>';
}
}
else {
echo '<p>TEXT ONLY PLEASE</p>';
}
?>
Strange
I recently noticed some odd HTML appear in some of the websites I host. Not all of them are run on a CMS but the majority (but not all) are running through the same FTP account.I've searched
Issues: PHP Forms -Clearing
I've tried looking online before actually asking for help, but I've been looking for about the past 3-5 hours and have found nothing that'll help me.This is a project for school, and well I have to
Data storage spaces in varchar2
Trying to understand what's happening.
Rss feed question
HiMy blog and my website are different. Am i able to take my rss feed from my blog and place it on the index page of my site using php and how to I do it (do I need soap)?
AJAX form submit
I recently built a form that submits data to my database with an ajax function that is called through onClick="function ..." on the submit button. That all works perfectly, however the
C - Reading a file into a byte array
Hi,I'm trying to read a file into a byte array in C. I have to use C as this is for a loadrunner script which is based on the C programming languageThe .Net code from the developers I'm basically
Deleting pointers froms vector?
Hi. I have a vector filled with pointers and I want to delete the pointers. I could do a loop and do delete on all indexes, but my question is that if I just clear the vector. Are the pointers
From Header Showing 'Unkown' In Hotmail? Why?
Code: $to = $row_GetID['email_addr'].',sales@mywebaddress.co.uk'; $subject = 'Thank you for your www.mywebaddress Order'.' ('.$row_GetID['ordernum_ID'].')';$headers = 'From:web@mywebaddress.co.uk';if
Coding question?
Hey guys, I have a quick question. If I want to make a way for people to pay for health in my game, how would I go about coding that? Would be like this?Code: ($purchace = 1000000) ==
user data not transferring to new page
I'm a PHP learner. After an index.php page, the user goes to a login.php page. Both pages seem to be working.After logging in with username, password, and a special code, the user is transferred to