Turn on thread page Beta
    • Thread Starter
    Offline

    20
    ReputationRep:
    I need to sanitise a variable but I have to think about the order in which i call the functions. I'm not really sure on how to do that?

    the information is as follows:

    $message = $_POST{'message'};

    I then inserted below that, this:

    $message = escape_tags ($message)

    but then i get a message saying that "I have sanitised the $message variable correctly but the result of the sanitisation isn't being inserted into the database. Think about the order in which you call the functions."
    Offline

    7
    ReputationRep:
    $message = $_POST{'message'};$message = escape_tags ($message)insetIntoDatabase($mes sage);hope this works
    Offline

    21
    ReputationRep:
    (Original post by blogbyreviews)
    I need to sanitise a variable but I have to think about the order in which i call the functions. I'm not really sure on how to do that?

    the information is as follows:

    $message = $_POST{'message'};

    I then inserted below that, this:

    $message = escape_tags ($message)

    but then i get a message saying that "I have sanitised the $message variable correctly but the result of the sanitisation isn't being inserted into the database. Think about the order in which you call the functions."



    This is hardly 'advice on everyday issues'...
    • #1
    #1

    $message = $_POST{'message'};
    $message = escape_tags ($message)
    insertIntoDatabase($message);
    hope this helps
    • Thread Starter
    Offline

    20
    ReputationRep:
    I didn’t know which section to put it in....
    • Thread Starter
    Offline

    20
    ReputationRep:
    (Original post by emmakola)
    in that order
    No sorry I was trying to reply to Reality check but it wouldn’t let me quote message.
    Posted on the TSR App. Download from Apple or Google Play
    • Thread Starter
    Offline

    20
    ReputationRep:
    (Original post by emmakola)
    $message = $_POST{'message'};$message = escape_tags ($message)insetIntoDatabase($mes sage);hope this works
    I’ll try it
    (Original post by emmakola)
    $message = $_POST{'message'};$message = escape_tags ($message)insetIntoDatabase($mes sage);hope this works
    I’ll try it
    Posted on the TSR App. Download from Apple or Google Play
    Offline

    18
    ReputationRep:
    What are you trying to do here? Don't try to prevent SQL injection attacks by sanitising your data, instead you should prevent SQL injection attacks by parameterising your queries.

    Have a look here: http://bobby-tables.com/php
    • Thread Starter
    Offline

    20
    ReputationRep:
    (Original post by winterscoming)
    What are you trying to do here? Don't try to prevent SQL injection attacks by sanitising your data, instead you should prevent SQL injection attacks by parameterising your queries.

    Have a look here: http://bobby-tables.com/php
    it's for the silver IDEA award. Quite a few are on coding and I can't wrap my head around it.
    • Thread Starter
    Offline

    20
    ReputationRep:
    (Original post by anonymous)
    $message = $_post{'message'};
    $message = escape_tags ($message)
    insertintodatabase($message);
    hope this helps
    thank you! It worked
    Offline

    7
    ReputationRep:
    (Original post by blogbyreviews)
    it's for the silver IDEA award. Quite a few are on coding and I can't wrap my head around it.
    I am too I've managed to get to the build a robot on maker activation it's all about loops
    • Thread Starter
    Offline

    20
    ReputationRep:
    (Original post by emmakola)
    I am too I've managed to get to the build a robot on maker activation it's all about loops
    I'm stuck on the maker activation. IT'S SO HARD with all the coding.

    what do you do with the LifeSupportCheck? I don't know what I'm supposed to do
    Offline

    7
    ReputationRep:
    (Original post by blogbyreviews)
    I'm stuck on the maker activation. IT'S SO HARD with all the coding.

    what do you do with the LifeSupportCheck? I don't know what I'm supposed to do
    Yes I do
    Have you managed to run the loop? How far have you got using the pink hints
    • Thread Starter
    Offline

    20
    ReputationRep:
    (Original post by emmakola)
    Yes I do
    Have you managed to run the loop? How far have you got using the pink hints
    I'm only at the beginning of the coder's stage
    Offline

    7
    ReputationRep:
    (Original post by blogbyreviews)
    I'm only at the beginning of the coder's stage
    Okay function lifesSupportCheck (){

    }
    • Thread Starter
    Offline

    20
    ReputationRep:
    (Original post by emmakola)
    Okay function lifesSupportCheck (){

    }
    what do I do?
    Attached Images
     
    Offline

    7
    ReputationRep:
    Just write function in front of lifesSupportCheck
    • Thread Starter
    Offline

    20
    ReputationRep:
    (Original post by emmakola)
    Just write function in front of lifesSupportCheck
    thanks
    • Thread Starter
    Offline

    20
    ReputationRep:
    Name:  loop soundblocks.png
Views: 5
Size:  25.1 KBemmakola
    Offline

    7
    ReputationRep:
    (Original post by blogbyreviews)
    Name:  loop soundblocks.png
Views: 5
Size:  25.1 KBemmakola
    Remove lines 8 and 9 then run code
 
 
 
Poll
Black Friday: Yay or Nay?
Useful resources

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.