Jump to content

Kristoff1875

Members
  • Posts

    242
  • Joined

  • Last visited

Posts posted by Kristoff1875

  1. View01.php:

     

    <?PHP
    session_start();
    if(!isset($_SESSION['id']) || !isset($_SESSION['valid_user']) || $_SESSION['valid_user'] != "yes") {
    $_SESSION = array();
    session_destroy();
    header("Location: index.php");	
    exit();
    }
    

     

    I'm guessing that header is what is causing the page to always go to index.php?

     

    One of the other guys will know more what they're talking about, but to me that looks like you're saying  if the session is valid, then to close it and send the user to the index page?

     

    As I say, others will know more than me, but that's how it looks to me?

  2. Others will know more than me, but can't you grab the message ID from the url, and then pass it as an variable in to your url, for example:

     

    	
    
    // *************************************************************
    
    
    
    // HANDLE FORM.
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    *
    
    
    
    // *************************************************************
    
    
    
    if ($_SERVER['REQUEST_METHOD']=='POST'){
    
    
    
    
    
    // Form was Submitted (Post).
    
    
    
    
    
    if ($_POST['submit']=="Reply"){
    
    
    
    
    
    
    
    // Redirect to Reply PM page.
    
    
    
    
    
    
    
    header("Location: " . BASE_URL . "/account/reply_pm.php?msg=".$msg."");
    
    
    
    
    
    
    
    // End script.
    
    
    
    
    
    
    
    exit();
    

     

    As i've said, i'm no expert, and others will know better, but in my mind that is what you're looking to do?

  3. Also needed to add (string) to the xml call, so for anyone who ever finds this on a search:

     

    $make = (string)$xml->REQUEST->MB01->MAKE; 

     

    And then:

     

    session_start();
    
    $_SESSION['make'] = $make;

     

    I'm assuming that is correct as it is echoing the variable correctly on the next page using:

     

    <? echo $_SESSION['make']; ?>

  4. I've currently, after some great help from Barand, got a remote XML that I grab values from, but now I am having an issue storing them in to a PHP session and I keep getting errors?

     

    My values are being called as follows:

     

    $make = $xml->REQUEST->MB01->MAKE; 
    
    <p><strong>Make:</strong> <? echo $make; ?></p>
    

     

    Which is working fine, but i've got the following:

     

    <?php
    session_start();
    
    session_register('make');
    
    $_SESSION['make'] = $make];
    ?>

     

    Which is giving out the following error:

     

    Warning: session_start() [function.session-start]: Node no longer exists in page.php on line 2

     

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at page.php on line 2

     

    Warning: Unknown: Node no longer exists in Unknown on line 0

     

    Any ideas what's up?!

     

    Thanks in advance!

     

    EDIT: There are currently no header functions in the coding.

  5. Next question for you now (sorry!!!!) is there a way of taking those values and only showing a selection of them rather than all of them and how would I go about just storing the values and passing them to the next page? Is it a case of sending it via the url or can I hide them by sending them as hidden form fields?

  6. I was getting errors when adding extra code, assuming it was because of the header being set as xml:

     

    header('Content-type: text/xml');

     

    So after taking that out and adding your code at the end, i've now got the following error:

     

    Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "uat.xml" in formaction.php on line 48

     

    Is that because it's not saving imported result correctly?

  7. formaction.php file:

     

    <?php
    
    
    header('Content-type: text/xml');
    
    //extract data from the post
    extract($_POST);
    
    //set POST variables
    $url = 'https://www.***.com/UAT/';
    $fields = array(
                'ESERIES_FORM_ID'=>urlencode($ESERIES_FORM_ID),
                'MXIN_USERNAME'=>urlencode($MXIN_USERNAME),
                'MXIN_PASSWORD'=>urlencode($MXIN_PASSWORD),
                'MXIN_VRM'=>urlencode($MXIN_VRM),
                'MXIN_TRANSACTIONTYPE'=>urlencode($MXIN_TRANSACTIONTYPE),
                'MXIN_PAYMENTCOLLECTIONTYPE'=>urlencode($MXIN_PAYMENTCOLLECTIONTYPE),
                'MXIN_CAPCODE'=>urlencode($MXIN_CAPCODE)
            );
    
    //url-ify the data for the POST
    foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
    rtrim($fields_string,'&');
    
    //open connection
    $ch = curl_init();
    
    //set the url, number of POST vars, POST data
    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_POST,count($fields));
    curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
    
    //execute post
    $result = curl_exec($ch);
    
    //close connection
    curl_close($ch);
    
    
    ?>

     

    Source of formaction.php:

     

    <?xml version='1.0' standalone='yes'?><GEODS exp_cid='809i'><REQUEST type='RETURN' subtype='CALLBUR' EXP_ExperianRef='' success='Y' timestamp='Mon, 21 May 2012 at 1:48 PM' id='809i'><MB01 seq='01'><DATEOFTRANSACTION>20020725</DATEOFTRANSACTION><VRM>WF02LPZ </VRM><VINCONFIRMATIONFLAG>0</VINCONFIRMATIONFLAG><ENGINECAPACITY>01199</ENGINECAPACITY><DOORPLAN>13</DOORPLAN><DATEFIRSTREGISTERED>20020625</DATEFIRSTREGISTERED><YEAROFMANUFACTURE>2002</YEAROFMANUFACTURE><SCRAPPED>0</SCRAPPED><EXPORTED>0</EXPORTED><IMPORTED>0</IMPORTED><MAKE>VAUXHALL</MAKE><MODEL>CORSA COMFORT 16V SEMI-AU</MODEL><COLOUR>RED</COLOUR><TRANSMISSION>MANUAL 5 GEARS</TRANSMISSION><ENGINENUMBER>19W84037</ENGINENUMBER><VINSERIALNUMBER>W0L0XCF0824252589</VINSERIALNUMBER><DOORPLANLITERAL>3 DOOR HATCHBACK</DOORPLANLITERAL><MVRISMAKECODE>D8</MVRISMAKECODE><MVRISMODELCODE>AHA</MVRISMODELCODE><DTPMAKECODE>DB</DTPMAKECODE><DTPMODELCODE>858</DTPMODELCODE><TRANSMISSIONCODE>M</TRANSMISSIONCODE><GEARS>5</GEARS><FUEL>PETROL</FUEL><CO2EMISSIONS>149</CO2EMISSIONS><USEDBEFORE1STREG>0</USEDBEFORE1STREG><IMPORTNONEU>0</IMPORTNONEU><UKDATEFIRSTREGISTERED>20020625</UKDATEFIRSTREGISTERED><MAKEMODEL>VAUXHALL CORSA COMFORT 16V SEMI-AU</MAKEMODEL></MB01><MB12 seq='01'><CAPCODE>VACO12C1E3HPIA  1</CAPCODE></MB12></REQUEST></GEODS>

  8. <GEODS exp_cid="41C2"><REQUEST type="RETURN" subtype="CALLBUR" EXP_ExperianRef="" success="Y" timestamp="Mon, 21 May 2012 at 12:04 PM" id="41C2"><MB01 seq="01"><DATEOFTRANSACTION>20000628</DATEOFTRANSACTION><VRM>W******</VRM><VINCONFIRMATIONFLAG>0</VINCONFIRMATIONFLAG><ENGINECAPACITY>01989</ENGINECAPACITY><DOORPLAN>14</DOORPLAN><DATEFIRSTREGISTERED>20000531</DATEFIRSTREGISTERED><YEAROFMANUFACTURE>2000</YEAROFMANUFACTURE><SCRAPPED>0</SCRAPPED><EXPORTED>0</EXPORTED><IMPORTED>0</IMPORTED><MAKE>FORD</MAKE><MODEL>FOCUS GHIA</MODEL><COLOUR>BLACK</COLOUR><TRANSMISSION>MANUAL 5 GEARS</TRANSMISSION><ENGINENUMBER>XU20092</ENGINENUMBER><VINSERIALNUMBER>WF0AXXGCDAXU20092</VINSERIALNUMBER><DOORPLANLITERAL>5 DOOR HATCHBACK</DOORPLANLITERAL><MVRISMAKECODE>M1</MVRISMAKECODE><MVRISMODELCODE>AJZ</MVRISMODELCODE><DTPMAKECODE>M1</DTPMAKECODE><DTPMODELCODE>868</DTPMODELCODE><TRANSMISSIONCODE>M</TRANSMISSIONCODE><GEARS>5</GEARS><FUEL>PETROL</FUEL><CO2EMISSIONS>*</CO2EMISSIONS><USEDBEFORE1STREG>0</USEDBEFORE1STREG><IMPORTNONEU>0</IMPORTNONEU><UKDATEFIRSTREGISTERED>20000531</UKDATEFIRSTREGISTERED><MAKEMODEL>FORD FOCUS GHIA</MAKEMODEL></MB01><MB12 seq="01"><CAPCODE>FOFO20GH 5HPIM  1</CAPCODE></MB12></REQUEST></GEODS>

     

    Here is the XML result

  9. I'm getting data from a remote XML file using the following as a result of a form:

     

    <?php
    
    header('Content-type: text/xml');
    
    //extract data from the post
    extract($_POST);
    
    //set POST variables
    $url = 'https://www.*******';
    $fields = array(
                'ESERIES_FORM_ID'=>urlencode($ESERIES_FORM_ID),
                'MXIN_USERNAME'=>urlencode($MXIN_USERNAME),
                'MXIN_PASSWORD'=>urlencode($MXIN_PASSWORD),
                'MXIN_VRM'=>urlencode($MXIN_VRM),
                'MXIN_TRANSACTIONTYPE'=>urlencode($MXIN_TRANSACTIONTYPE),
                'MXIN_PAYMENTCOLLECTIONTYPE'=>urlencode($MXIN_PAYMENTCOLLECTIONTYPE),
                'MXIN_CAPCODE'=>urlencode($MXIN_CAPCODE)
            );
    
    //url-ify the data for the POST
    foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
    rtrim($fields_string,'&');
    
    //open connection
    $ch = curl_init();
    
    //set the url, number of POST vars, POST data
    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_POST,count($fields));
    curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
    
    //execute post
    $result = curl_exec($ch);
    
    //close connection
    curl_close($ch);
    
    
    ?>

     

    Which is displaying what was the remote XML page, but has brought it to my domain.

     

    How would I go about taking the results of the displaying XML page and displaying them on the next page rather than just displaying the XML data?

     

    Many thanks in advanced!

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.