Jump to content

echo help


newbtophp

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.