Jump to content

Error will display but echo will not.... help


Chrisj

Recommended Posts

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by Chrisj
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
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.