Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

whats wrong with this php

  • 02-02-2008 10:04PM
    #1
    Closed Accounts Posts: 94 ✭✭


    im having a problem and I cannot figure out whats wrong

    heres my php code:

    if (substr(base64_decode($thelink), 0, 21)="http://**********.com") {
    echo 'this maybe an attempt to trick the system,your account has been flagged.You cannot double link.';
    }

    I get

    Parse error: syntax error, unexpected '=' in /home/***/public_html/***.php on line 10

    i cant see anything wrong here!

    EDIT: just noticed I used one = instead of two =

    if (substr(base64_decode($thelink), 0, 21)="http://**********.com") {

    should have been

    if (substr(base64_decode($thelink), 0, 21)=="http://**********.com") {


Comments

  • Registered Users, Registered Users 2 Posts: 3,594 ✭✭✭forbairt


    you're doing a numerical compare instead of a string compare ... for one ?

    strcmp its a handy function ... :)


  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    gnomer wrote: »
    EDIT: just noticed I used one = instead of two =

    if (substr(base64_decode($thelink), 0, 21)="http://**********.com") {

    should have been

    if (substr(base64_decode($thelink), 0, 21)=="http://**********.com") {
    and I take it this solved your problem?


  • Closed Accounts Posts: 94 ✭✭gnomer


    yeah it solved it its perfect now.

    I got confused between the if and else in VB and in PHP.

    I looked at the PHP 100 times and kept saying one = is ok cos its PHP,when thats olny in VB.

    thanks anyways :)


Advertisement
Advertisement