Jump to content

Recommended Posts

Im haivng some trouble when i place.

 

echo "\x64\x69\"; and open it in a browser it echos text.

 

but when i put that some code in a field and submit it just echos whats been submitted.

 

<?php
$code = stripslashes($_POST['code']);
$submit = $_POST['submit'];
if($code == "") echo "";
else {


echo "$code";


}
?> 

Link to comment
https://forums.phpfreaks.com/topic/174227-echo-help/
Share on other sites

Not entirely sure what you want to accomplish here but I would change your if condition to read cleaner by doing this.

 

if (!$code == "") {
    echo $code;
}

 

The ! means 'NOT'... so it will only run the code block if $code is NOT "". 

 

Please provide more info on what you want to accomplish and I will try to help.

Link to comment
https://forums.phpfreaks.com/topic/174227-echo-help/#findComment-918484
Share on other sites

Thanks for all your replies, not still no luck.

 

Let me further explain, if you copy this code, save it and open it:

 

<?php
echo "\x64\x69\x73\x70\x6C\x61\x79";

?>

 

You'll get:

 

display

 

 

I've created a form which uses $_POST to submit \x64\x69\x73\x70\x6C\x61\x79 (code) and echo it which is supposed to give: display

 

But is just echoing whats been inserted.

Link to comment
https://forums.phpfreaks.com/topic/174227-echo-help/#findComment-918504
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.