Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

whats wrong with this php

Options
  • 02-02-2008 11: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 Posts: 3,594 ✭✭✭forbairt


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

    strcmp its a handy function ... :)


  • Registered Users 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