Chrisj Posted January 4, 2023 Share Posted January 4, 2023 In my php, the error will display in the html, but echo will not: if($_SERVER["REQUEST_METHOD"] == "POST"){ . . . if (empty($error) && $_POST['field'] == etc... { echo "Hello"; $error = "Hello"; . . . etc. Any ideas how to get echo to display? Quote Link to comment https://forums.phpfreaks.com/topic/315755-error-will-display-but-echo-will-not-help/ Share on other sites More sharing options...
ginerjm Posted January 4, 2023 Share Posted January 4, 2023 I do not understand what you are saying. The error will display in the html? Do you mean on your screen from our page? And what is the rest of this meaningless script suppose to be demonstrating to us? How about a bit more code to help us debug it for you? Quote Link to comment https://forums.phpfreaks.com/topic/315755-error-will-display-but-echo-will-not-help/#findComment-1604168 Share on other sites More sharing options...
maxxd Posted January 4, 2023 Share Posted January 4, 2023 Yeah, we're gonna need some more information. Copy the error and paste it here. Also, while I appreciate your attempt to not post unrelated code, you do need to post all the related code. We don't need the CSS or JavaScript, but the php and html directly associated with this functionality is necessary. Quote Link to comment https://forums.phpfreaks.com/topic/315755-error-will-display-but-echo-will-not-help/#findComment-1604169 Share on other sites More sharing options...
Chrisj Posted January 4, 2023 Author Share Posted January 4, 2023 (edited) Thanks for the replies. Sorry for my lack of info. The php ffmpeg_submit.php file is for it's accompanying html ffmpeg.html form-submitting file. Whatever I enter into the Error will display successfully on the html page upon the 'if' conditions being met. I'd prefer it not being an Error message, but it's the only thing that will display, as I test and try to determine how to display a message there, rather than an error. if (empty($error) && $_POST['set_p_v'] == 0 && $wallet >=1) { echo "Hello"; $error = "Whatever I enter here gets displayed upon these if conditions being met"; $db->rawQuery("UPDATE ".T_USERS." SET `wallet` = `wallet` - 0.50 WHERE $wallet = $user->wallet"); } So, it would seem that the code is working successfully, because when the if conditions are met the error message is displayed successfully. So, my question is, how do I instead modify it so that, if conditions are met display the echo message, or is there another way to have the php display a message onto the html page? I look forward to your reply. Edited January 4, 2023 by Chrisj Quote Link to comment https://forums.phpfreaks.com/topic/315755-error-will-display-but-echo-will-not-help/#findComment-1604180 Share on other sites More sharing options...
maxxd Posted January 4, 2023 Share Posted January 4, 2023 Where is $error output? I don't see the file `ffmpeg_submit.php` in the source for PHP-FFMpeg on GitHub so I assume it's something you've written. It could be as simple as creating a different variable and outputting that instead of (or in addition to) the $error variable, but as we can't see your code there's no way for us to tell. Quote Link to comment https://forums.phpfreaks.com/topic/315755-error-will-display-but-echo-will-not-help/#findComment-1604196 Share on other sites More sharing options...
mac_gyver Posted January 4, 2023 Share Posted January 4, 2023 8 hours ago, Chrisj said: $error = "Whatever I enter here gets displayed upon these if conditions being met"; this is a sign that your php code isn't being executed, but is instead being output to the browser, where the browser is only 'rendering' the quoted string. what does the 'view source' in your browser show? Quote Link to comment https://forums.phpfreaks.com/topic/315755-error-will-display-but-echo-will-not-help/#findComment-1604198 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.