Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Senior Coder
    Join Date
    May 2006
    Posts
    1,673
    Thanks
    28
    Thanked 4 Times in 4 Posts

    Getting No error reporting only Blank Screen

    Hi

    I am running PHP version 5.3.2

    My script starts off with picking up a variable using GET and displaying
    it on the screen then exits.

    I get NOTHING !!!

    Now there maybe something wrong in the script after the exit, so maybe it is not compiling, but if that is the case WHY am I not getting the error reporting ?

    I used to get the errors but I think the php was updated and now I just get blank screen !

    I thought the ini_set ("display_errors", "1"); error_reporting(E_ALL); would force error reporting ( over riding whatever the php.ini file says

    NO ?

    Here is the full script

    PHP Code:
    <?php 
    /*
    *  activate.php
    *

    *  
    */

    if(session_id() == ''){session_start();}

    //  Turn ON the error display

    ini_set ("display_errors""1");
    error_reporting(E_ALL);  

    // require_once("my_functions.php");

    $mail_prog $_SERVER['DOCUMENT_ROOT']."/send_email.php"

    $the_key $_GET["a"];

    echo 
    "<br>The_key: $the_key <br> Client_no:$client_no<br><br>";
    exit();

    $sql "SELECT client_no,gift_key FROM gifts where gift_id = '$the_key'";
    $result mysql_query($sql)    or die("could not execute FIND CLIENT query."mysql_error());  
    $num mysql_num_rows($result);

    if (
    $num == ) { //  if the  client does not exist
     
        
    $the_text =  "For some strange reason your user id  is not registered on the system.<br>
            <br>
            If you require assistance, <br>
            please send an email to administration <br>
            via the  <a href=\"/contact.php\">contact page</a>.
            <br><br>
            Or If you have another email account - just try again :)"
    ;
        }  
    // endif    
    else{        //    If the gift is found 
        
    $gift_key "{$row['gift_key']}";    
        
    $client_no "{$row['client_no']}";    
        
        echo 
    "<br>$gift_key: Gift_key <br> Client_no:$client_no<br><br>";
        exit();
        
    $the_text "Congratulations -- You're in ! 
        <br><br>
        Here is your Plugin code:
        <br><br>
        <div class=\"plugin\">
        <pre>
        &lt;div style="
    width:240px"&rt;&lt;center&rt;
        &lt;span style="
    font-size:14pxcolor:redfont-weightbold;"&rt;Get Your Free Download NOW!&lt;/span&rt;
        &lt;br&rt;&lt;br&rt;
        &lt;form name="
    regis" action ='http://expressresponse.net/sys/lead_gen.php' method = 'POST'&rt;
        &lt;span&rt;&lt;input type='hidden' name = 'xrkey' value = "
    &lt;?php echo $gift_key ?&rt;" &rt;&lt;/span&rt;
        &lt;span&rt;Name:&lt;/span&rt;
        &lt;span&rt;&lt;INPUT name="
    x_name" value= '' size="20" maxlength size="30" type="text"&rt;&lt;/span&rt;
        &lt;br&rt;&lt;br&rt;
        &lt;span&rt;Email:&nbsp;&lt;/span&rt;
        &lt;span&rt;&lt;INPUT name="
    x_email" value= '' size="20" maxlength size="60" type="text"&rt;&lt;/span&rt;
        &lt;br&rt;&lt;br&rt;
        &lt;input  type="
    submit" value="Click Here"&rt;
        &lt;/form&rt;&lt;/center&rt;&lt;/div&rt;
        </pre>
        </div> 
        <br><br>
         You can use the plugin script immediately to build for list,<br>
         or you can login and add outgoing messages from your Control Panel.<br>
         <br><br>
         <a href=\"/login_fm.php\">Now Login</a>.
        <br><br>
        <br><br>"
    ;
        
        
    $sql "UPDATE clients set confirm = 'y' WHERE client_id = '$client_no'";
        
    $result mysql_query($sql) or die("could not execute UPDATE CLIENT-CONFIRM query."mysql_error());  
        }  
    // end else
    require_once("a_head.php");    
    ?>
    <h1><center><i>Get Building Your List Now!</i></center></h1>
            
            <h3>Welcome to the fastest easiest way to build you list.</h3>
            <p>
                <?php echo "$the_text";    ?>    
                <br><br>
            </p>
            
    <?php 
    require_once("footer.php"); 
    ?>

    The script is called with:
    http://www.expressresponse.net/activate.php?a=3



    Would really appreciate help as it is affecting all my script writing.

    PS As I said there is probably an error in the script where I am trying to have some HTML displayed on the screen. But that should maybe be another thread

    Thanks


    .
    Last edited by jeddi; 01-21-2012 at 10:11 AM.
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #2
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,292
    Thanks
    4
    Thanked 202 Times in 199 Posts
    You didn't escape all of your double quotes in the $the_text variable in your else clause as you did elsewhere.

    PHP Code:
    $the_text "Congratulations -- You're in ! 
        <br><br>
        Here is your Plugin code:
        <br><br>
        <div class=\"plugin\">
        <pre>
        &lt;div style=\"width:240px\"&rt;&lt;center&rt;
        &lt;span style=\"font-size:14px; color:red; font-weight: bold;\"&rt;Get Your Free Download NOW!&lt;/span&rt;
        &lt;br&rt;&lt;br&rt;
        &lt;form name=\"regis\" action ='http://expressresponse.net/sys/lead_gen.php' method = 'POST'&rt;
        &lt;span&rt;&lt;input type='hidden' name = 'xrkey' value = \"&lt;?php echo $gift_key ?&rt;\" &rt;&lt;/span&rt;
        &lt;span&rt;Name:&lt;/span&rt;
        &lt;span&rt;&lt;INPUT name=\"x_name\" value= '' size=\"20\" maxlength size=\"30\" type=\"text\"&rt;&lt;/span&rt;
        &lt;br&rt;&lt;br&rt;
        &lt;span&rt;Email:&nbsp;&lt;/span&rt;
        &lt;span&rt;&lt;INPUT name=\"x_email\" value= '' size=\"20\" maxlength size=\"60\" type=\"text\"&rt;&lt;/span&rt;
        &lt;br&rt;&lt;br&rt;
        &lt;input  type=\"submit\" value=\"Click Here\"&rt;
        &lt;/form&rt;&lt;/center&rt;&lt;/div&rt;
        </pre>
        </div> 
        <br><br>
         You can use the plugin script immediately to build for list,<br>
         or you can login and add outgoing messages from your Control Panel.<br>
         <br><br>
         <a href=\"/login_fm.php\">Now Login</a>.
        <br><br>
        <br><br>"

    Dave .... HostMonster for all of your hosting needs

  • #3
    Senior Coder
    Join Date
    May 2006
    Posts
    1,673
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Thanks,

    I will escape them.

    (actually can I use single quotes instead ?)


    BUT why am I not getting any error displayed on my screen ?

    It looks like this is not working:

    PHP Code:
    ini_set ("display_errors""1"); 
    error_reporting(E_ALL); 

    .
    Last edited by jeddi; 01-21-2012 at 02:08 PM.
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #4
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    I'm pretty sure that code wouldn't run (the ini set and error reporting that is) because the script is invalid, therefore it doesn't run any statements. You are best using a php.ini file in your document root if your hosting allows them, or use .htaccess to do the same thing. Check out this page for advice on this
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #5
    Regular Coder
    Join Date
    Apr 2004
    Posts
    298
    Thanks
    0
    Thanked 23 Times in 23 Posts
    aside...

    isn't this...
    PHP Code:
        exit(); /* YOU ARE CAUSING SCRIPT TO END HERE */
        
    $the_text "Congratulations -- You're in ! 
    causing $the_text NOT to be processed???

  • #6
    Senior Coder
    Join Date
    May 2006
    Posts
    1,673
    Thanks
    28
    Thanked 4 Times in 4 Posts
    Thanks for all your advice.

    I have got it working properly now.

    Just one question ...

    Instead of escaping all those double quotes, most of them can be
    single quotes can't they ?
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #7
    Regular Coder
    Join Date
    Dec 2009
    Location
    UK
    Posts
    495
    Thanks
    0
    Thanked 58 Times in 58 Posts
    While there's no specific reason not to, personally I think you are better using double quotes rather than single quotes for tag properties. Instead, why not try Heredoc syntax instead
    PHP Code:
    $the_text = <<<EOF
    Congratulations -- You're in ! 
        <br><br>
        Here is your Plugin code:
        <br><br>
        <div class="plugin">
        <pre>
        &lt;div style="width:240px"&rt;&lt;center&rt;
        &lt;span style="font-size:14px; color:red; font-weight: bold;"&rt;Get Your Free Download NOW!&lt;/span&rt;
        &lt;br&rt;&lt;br&rt;
        &lt;form name="regis" action ='http://expressresponse.net/sys/lead_gen.php' method = 'POST'&rt;
        &lt;span&rt;&lt;input type='hidden' name = 'xrkey' value = "&lt;?php echo $gift_key ?&rt;" &rt;&lt;/span&rt;
        &lt;span&rt;Name:&lt;/span&rt;
        &lt;span&rt;&lt;INPUT name="x_name" value= '' size="20" maxlength size="30" type="text"&rt;&lt;/span&rt;
        &lt;br&rt;&lt;br&rt;
        &lt;span&rt;Email:&nbsp;&lt;/span&rt;
        &lt;span&rt;&lt;INPUT name="x_email" value= '' size="20" maxlength size="60" type="text"&rt;&lt;/span&rt;
        &lt;br&rt;&lt;br&rt;
        &lt;input  type="submit" value="Click Here"&rt;
        &lt;/form&rt;&lt;/center&rt;&lt;/div&rt;
        </pre>
        </div> 
        <br><br>
         You can use the plugin script immediately to build for list,<br>
         or you can login and add outgoing messages from your Control Panel.<br>
         <br><br>
         <a href="/login_fm.php">Now Login</a>.
        <br><br>
        <br><br>
    EOF; 
    My site: JayGilford.com
    Resources:
    PHP Pagination Class | Getting all page links | Handling PHP Errors properly
    If you like a users help, show your appreciation with the rep and thanks buttons :)

  • #8
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Yes they can be but you have to be consistent. If you use double quotes to start the string then use single quotes within if you don't want to escape them, same goes for starting with single quotes, make sure to use double quotes within your string. Note however that if you want variables to be parsed in a string e.g.
    PHP Code:
    $somevar "test";
    echo 
    "The value of somevar is $somevar"// yields The value of somevar is test 
    Then you need to use double quotes. This
    PHP Code:
    $somevar "test";
    echo 
    The value of somevar is $somevar"; // yields The value of somevar is 
    Will not work. If you started with single quotes and wanted variables to be parsed to you need to concat them e.g.
    PHP Code:
    $somevar "test";
    echo 
    'The value of somevar is '.$somevar.' and it is concatenated'// yields The value of somevar is test and it is concatenated. 
    The same can be used for double quotes too e.g.
    PHP Code:
    echo "The value of somevar is ".$somevar." and it is concatenated"
    It takes a bit longer to parse but it isn't noticeable. The heredoc syntax can be useful as well.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #9
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,589
    Thanks
    0
    Thanked 644 Times in 634 Posts
    Another alternative where you have a large block of HTML to output is to wrap it inside of

    ?>
    <p>Regular HTML content</p>
    <?php
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •