Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8030081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:39:10+00:00 2026-06-05T00:39:10+00:00

Possible Duplicate: How can I tell PHP to dump exceptions as raw text instead

  • 0

Possible Duplicate:
How can I tell PHP to dump exceptions as raw text instead of HTML?

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).

Heres the code I am using

// 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());

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

Error I am trying to avoid

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 <div>, <br>, <a>, 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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T00:39:11+00:00Added an answer on June 5, 2026 at 12:39 am

    Whether PHP displays plain text or html errors depends on your php.ini configuration:

    html_errors boolean

    Turn off HTML tags in error messages. The new format for HTML errors produces clickable messages that direct the user to a page describing the error or function in causing the error. These references are affected by docref_root and docref_ext.

    The setting is settable as PHP_INI_ALL, which means anywhere, including your script. So to disable html errors do

    ini_set('html_errors', false);
    

    at the beginning of your script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Can anybody suggest the best image resize script in php? I'm still
Possible Duplicate: Can a Bash script tell what directory it's stored in? Is there
Possible Duplicate: How can you programmatically tell an HTML SELECT to drop down (for
Possible Duplicate: How to tell if a list is infinite? In Haskell, you can
Possible Duplicate: How can I convert ereg expressions to preg in PHP? I need
Possible Duplicate: Why can't decimal numbers be represented exactly in binary? I am trying
Possible Duplicate: Special (magic) methods in Python who can tell me what can call
Possible Duplicate: How can I tell whether an element matches a selector? I've been
Possible Duplicate: Problem installing my Android apps Any body can tell me how can
Possible Duplicate: gcc-4.2 failed with exit code 1 iphone Can anybody tell what does

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.