Jump to content

jason360

Members
  • Content Count

    77
  • Joined

  • Last visited

Community Reputation

0 Neutral

About jason360

  • Rank
    Regular Member

Profile Information

  • Gender
    Not Telling
  1. Okay...thanks for the info. Looks like I got a big job ahead of me switching to mysqli.
  2. Hello, I am trying to insert this string into my data base but it is failing and I am getting my die message. Anyone see why this is not working? I am connected to my database too. $string="Toyota, Volkswagen, Samsung, Ford, HewlettPackard"; $string=explode(',',$string); foreach($string as $val) { $val=strtolower($val); mysql_query('INSERT INTO companies (brands) VALUES ("'.$val[0].'")') or die ('fail insert'); }
  3. Hey guys, I am stumped on this htaccess write rule. I currently have this rule functioning: RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /item\.php\?pid=([a-z0-9]+)\ HTTP/ [NC] RewriteRule ^item\.php$ http://www.mysite.com/%1? [R=301,L] RewriteRule ^([-a-z0-9]+)$ /item.php?pid=$1 [NC,L] Original url: http://www.mysite.com/item.php?pid=2015-hyundai-genesis-coupe enabling this url: http://www.mysite.com/2015-hyundai-genesis-coupe What I require is a url like this: http://www.mysite.com/item/2015-hyundai-genesis-coupe I tried a bunch of things with no success. Anyone familiar with this? Thanks!
  4. Hey guys, I am not sure how to phrase this WHERE statement. I currently have this: WHERE approved = "1" AND item_gender="1" OR item_gender="3" It seems to be omitting the 'approved' part. What I require is that approved=1 must be adhered to regardless, but item_gender can be equal to 1 or 3. Any ideas what I am doing wrong? Thanks!
  5. Thanks for the prompt reply Psycho. I used your wildcard clean up and also found my problem. When being posted I was getting \" instead of just \. Used stripslashes function. Working like a charm now. I couldn't figure it out...I felt like i was on crazy pills...haha Thanks again! JK
  6. UPDATE: I realize it was this term triggering my preg_match: 42" AJ Slick How can I get it to accept " ' and + This is what I am using now: if(preg_match('/[^a-z0-9\-\_\,\!\?\+\"\'\ \.]+/i',$_POST['title'])) { $err[]='<p class="error" style="color: #ed1c24;">Your Name contains invalid characters!</p>'; }
  7. Anyone know why my preg_match is being triggered by this term: 3D Hobby Shop To me it should allow letters and numbers etc. My php: if(preg_match('/[^a-z0-9\-\_\,\!\?\+\ \.]+/i',$_POST['title'])) { $err[]='<p class="error" style="color: #ed1c24;">Your Title contains invalid characters!</p>'; }
  8. Is it possible to put an if statement within a return? Not sure if this is possible. Thank you. Example: return ' <div id="comment"> </div> '; The if statement to go into the return: if ($a > $b) { echo "a is bigger than b"; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.