Unstoppable Domains

[Resolved] String checking acting up

Spaceship Spaceship
Watch

liam_d

The original NP Emo KidEstablished Member
Impact
25
string checking acting up

Hi all basically i am trying to check if a string starts with "<embed" or "<object" and if it doesn't then give an error, i have found out if i do this then it never works:

PHP:
if(substr($_POST['code'], 0, 6) != "<embed" || substr($_POST['code'], 0, 7) != "<object")

but if i do just one so if you remove the or bit for "<object" it works, but it won't let me do both together, any ideas?!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Solved, needed && not ||, thanks got to Mike aka AllDrops.com
 
0
•••
Perhaps if would be good to use strtolower or strtoupper to perform a case-insensitive comparison. A regular expression could be used too.
 
0
•••
Yeah i have already been advised to do so :)
 
0
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back