Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make PHP errors in text instead of HTML
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/8941243/how-can-i-tell-php-to-dump-exceptions-as-raw-text-instead-of-html">How can I tell PHP to dump exceptions as raw text instead of HTML?</a> </p> </blockquote> <p>I am trying to make a login script using C# and php and I plan on selling it as a 1 click install so I need it to be error proof. I am purposely trying to make mistakes in the setup, but whenever my php script has a mistake it has an HTML block output with the error when I just want a string output(refer to image).</p> <p>Heres the code I am using</p> <pre><code>// We will now set up our MySQL database login. The values should be self-explanatory. $sqlhost = "localhost"; $sqlusername = "unity"; $sqlpassword = "mypass123"; //we will now connect to our database $sqlcon = mysql_connect($sqlhost, $sqlusername, $sqlpassword) or die("Could not connect to database: " . mysql_error()); </code></pre> <p>When I have all the information it works fine and the rest of the code runs without an error. But if my password is wrong or the user doesn't have access then I get this error</p> <p><img src="https://i.stack.imgur.com/G4Ev0.jpg" alt="Error I am trying to avoid"></p> <p>I am retrieved the information from this page and it needs to be sent as plan text to be displayed properly. What I mean by this is that any HTML tags like <code>&lt;div&gt;, &lt;br&gt;, &lt;a&gt;,</code> etc and just generally makes the text output look bad. I want this to just display the text at the bottom the page because that logs the error itself. I dont need it to log twice and I dont need it to be formatted fancy. I need it in plain readable text so that if a user has an error they can send me the short text and I will be able to walk them through the fix. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload