PHP exit in C#?

Last post 03-08-2008 12:18 PM by rodolfobeban. 3 replies.

Sort Posts:

  • PHP exit in C#?

    03-08-2008, 11:32 AM

     Hi, I'm trying to translate this PHP script that goes at the top of a page to C#:

     

    1    <?php    
    3    session_start();
    4    
    5    if(!isset($_COOKIE['name'])) {
    6    
    7    	echo "access denied";
    8    	exit();}
    9    ?>
    

     I used the C# return, but it keeps loading the rest of the page.

    Any ideas?  

    Thanks in advance. 

    Filed under: ,
  • Re: PHP exit in C#?

    03-08-2008, 12:03 PM
    • Loading...
    • s10n
    • Joined on 01-12-2007, 5:16 PM
    • El Salvador
    • Posts 329

    use Response.Close();

  • Re: PHP exit in C#?

    03-08-2008, 12:14 PM

    Using that now I'm getting this:

    XML Parsing Error: no element found
    Line Number 1, Column 1: 

    This code is placed at the Page_Load method if it's of any help.

    Thanks for your answer. 

     

     

  • Re: PHP exit in C#?

    03-08-2008, 12:18 PM
    Answer

    Response.End();

    Did the trick. 

    Thanks. 

     

Page 1 of 1 (4 items)
Microsoft Communities
Page view counter