Log in

View Full Version : What's wrong with this code?



Colin-Roberts
28-09-2007, 12:00 AM
Fatal error: Call to undefined function: stripos() in /mounted-storage/home10/sub002/sc16051-AGLV/123/includes/parser.php on line 147

Line 147:

$flag = stripos($input[0],'iframe') === 1 ? '/__iframeON' : '';

Lines Around it:

## Replace element ATTRIBUTE=URL, formatted as below
/* Original regex: (?><[A-Z][A-Z0-9]*)(?>\s+[^>\s]+)*?\s*(?>(href|src|background)=)(?>([\\\'"])?)((?(?<=\\\')[^>\\\']+|(?(?<=")[^>"]+|[^> ]+)))(?(2)\\2|) */
# [0] <element attr="value"
# [1] attr
# [2] ", ' or empty
# [3] value
function html_replaceElement($input) {
// Flag iframes so we don't show the form more than once
$flag = stripos($input[0],'iframe') === 1 ? '/__iframeON' : '';
return str_replace($input[3],absoluteURL($input[3] . $flag),$input[0]);
}


Moved by NintendoNews (Forum Moderator) from Website Designing and Development: Please post in the correct section next time, thanks :)

Agnostic Bear
28-09-2007, 05:20 AM
PHP5+ only

Mr Macro
28-09-2007, 08:34 AM
Isn't it strpos(); ?

Colin-Roberts
28-09-2007, 10:23 AM
From Webhost: PHP v5.2.1

changing it to strpos worked... thanks +rep

Want to hide these adverts? Register an account for free!