1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Session

Discussion in 'PHP' started by kolucoms6, Oct 11, 2011.

  1. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #21
    How about Javascript? Cookies depend on it. If you're running NoScript or something similar, and not allowing that site, sessions won't work.
    SEMrush
     
    Rukbat, Oct 14, 2011 IP
    SEMrush
  2. kolucoms6

    kolucoms6 Active Member

    Messages:
    1,198
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #22
    Still waiting for some solution !!!
     
    kolucoms6, Oct 15, 2011 IP
  3. AliceWonder

    AliceWonder Peon

    Messages:
    41
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #23
    NoScript will not interfere with cookies.
    It is possible he has a php.ini configuration problem, has white space being sent before the opening <?php - or white space / html before setting the cookie.

    If you have access to the curl command, try the following:

    curl --head http://yourdomain/yourfile.php

    Paste the output here. Most Linux distributions come with it and I think OS X does too. You might have to download it for windows.

    You can get curl here: http://curl.haxx.se/download.html
     
    AliceWonder, Oct 15, 2011 IP
  4. kolucoms6

    kolucoms6 Active Member

    Messages:
    1,198
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #24
    kolucoms6, Oct 15, 2011 IP
  5. kolucoms6

    kolucoms6 Active Member

    Messages:
    1,198
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #25
    Any Help with session ? :(
     
    kolucoms6, Oct 16, 2011 IP
  6. kolucoms6

    kolucoms6 Active Member

    Messages:
    1,198
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #26
    I am using

    window.location.href="http://xxxxxxx.com/FD1.php";

    Is this the reason that I am loosing my session values ?
     
    kolucoms6, Oct 16, 2011 IP
  7. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #27
    Not in and of itself.

    And how could you not "have access to the command prompt"? If you're in Windows, use the Windows Key +R, type cmd in the window and you're at the command prompt. In Linux it depends on the distro you're using. How do you maintain your computer without the command prompt? And why did you restrict your access to it?
     
    Rukbat, Oct 16, 2011 IP
  8. kolucoms6

    kolucoms6 Active Member

    Messages:
    1,198
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #28
    I am using webhostingpad as my Hosting server and it a Linux based server !!!
     
    kolucoms6, Oct 16, 2011 IP
  9. kolucoms6

    kolucoms6 Active Member

    Messages:
    1,198
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #29
    I even tried hidden form field using POST method but it also NOT getting passed to the next page !!

    Going Mad !! :-((
     
    kolucoms6, Oct 16, 2011 IP
  10. kolucoms6

    kolucoms6 Active Member

    Messages:
    1,198
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #30
    When I tried


    <?php
    ini_set('display_errors', 1);
    error_reporting(E_ALL|E_STRICT);
    ?>


    I recvd :

     
    kolucoms6, Oct 16, 2011 IP
  11. webshore88

    webshore88 Active Member

    Messages:
    130
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    73
    #31
    if possible share your /home/xxxxx/public_html/xxxxx.com/FD.php code and programming flow
     
    webshore88, Oct 16, 2011 IP
  12. kolucoms6

    kolucoms6 Active Member

    Messages:
    1,198
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #32
    Here it goes :

    2 PHP pages: silver.php and FD.php

    silver.php Code :


    FD1.php :

     
    kolucoms6, Oct 16, 2011 IP
  13. kolucoms6

    kolucoms6 Active Member

    Messages:
    1,198
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #33
    What I feel , below Lines are the main culprit :

    var url="FD1.php";
    window.location.href=url;

    Window.open opens a new window as a new session! .... What u guys suggest ?
     
    kolucoms6, Oct 16, 2011 IP
  14. kolucoms6

    kolucoms6 Active Member

    Messages:
    1,198
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #34
    Trying window.parent.open() options... Lets seee
     
    kolucoms6, Oct 16, 2011 IP
  15. HuggyEssex

    HuggyEssex Member

    Messages:
    297
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    45
    #35
    Remove the white space on the second script, I said that in my original post lol. If you send anything to the browser even blank space it will not work. Change FD1.php to this:
    
    <?php
    session_start(); // start up your PHP session!
    ini_set('display_errors', 1);
    error_reporting(E_ALL|E_STRICT);
    if(session_id()){
    echo "Session started!";
    }else{
    echo "Session not started!";
    }
    
    $plan = $_SESSION['plan'];
    echo $plan;
    
    $PlanPrevValue='0';
    $PlanValue = '0' ;
    $PlanDuration='0';
    
    If ($plan == 'silver')
    {
    $PlanPrevValue='89.00';
    $PlanValue = '59.00' ;
    $PlanDuration =' 6 months ';
    session_destroy();
    }
    ElseIf ($plan == 'gold')
    {
    $PlanPrevValue='199.00';
    $PlanValue = '149.00' ;
    $PlanDuration =' 12 months ';
    session_destroy();
    }
    ElseIf ($plan == 'diamond')
    {
    $PlanPrevValue='299.00';
    $PlanValue = '249.00' ;
    $PlanDuration =' 24 months ';
    session_destroy();
    }
    elseIf ($plan == 'platinum')
    {
    $PlanPrevValue='299.00';
    $PlanValue = '349.00' ;
    $PlanDuration =' 36 months ';
    session_destroy();
    }
    else
    {
    $PlanPrevValue='0';
    $PlanValue = '0' ;
    $PlanDuration =' ';
    session_destroy();
    }
    ?>
    
    
    
    
    <?php include("top.php"); ?>
    <?php include("left.php"); ?>
    <td class="main_nav">
    <div id="main_text">
    
    
    <form name="FD" action="https://xxx.net/lpc/servlet/lppay" method="post" target="_blank"> 
    <input type="hidden" name="storename" value="00000000" /> 
    <input type="hidden" name="chargetotal" value=<? echo $PlanValue ?> /> 
    <input type="hidden" name="txnorg" value="eci" /> 
    <input type="hidden" name="mode" value="payplus" /> 
    <input type="hidden" name="txntype" value="sale" /> 
    <input type="submit" name="submit" value="Continue to secure payment form" /> 
    </form> 
    
    
    
    
    <?php include("bottom.inc"); ?>
    
    PHP:
     
    HuggyEssex, Oct 17, 2011 IP
  16. kolucoms6

    kolucoms6 Active Member

    Messages:
    1,198
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #36
    I still get above error.
     
    kolucoms6, Oct 17, 2011 IP
  17. kolucoms6

    kolucoms6 Active Member

    Messages:
    1,198
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    75
    #37
    Any More suggestions ?
     
    kolucoms6, Oct 19, 2011 IP
  18. HuggyEssex

    HuggyEssex Member

    Messages:
    297
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    45
    #38
    That means that something is being sent to the browser before the session was started. It's a very common error and all you need to do is remove anything that is being outputted before you call session_start();
     
    HuggyEssex, Oct 20, 2011 IP
  19. myjumj

    myjumj Peon

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #39
    I'm studying such matters.
     
    myjumj, Oct 20, 2011 IP
  20. NothingLikeThis

    NothingLikeThis Member

    Messages:
    113
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #40
    well in my case session_start() is causing an error:-(
    what can i do ??
     
    NothingLikeThis, Jan 27, 2012 IP