-
Posts
242 -
Joined
-
Last visited
Everything posted by Kristoff1875
-
I've never done anything like that to be honest, as I said before, i'm not an expert! How is it handling the form? Assuming that to have a submit button, you've got a form action?
-
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?
-
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?
-
Can you post your view01.php code please? As that seems to be redirecting to your index page.
-
What page are you ending up on when you click reply?
-
Can't you set up a test login for the users on here to sign in with? I'm just thinking it would maybe help people see what you are doing and the result you are getting?
-
Do you have a link to it?
-
Post information retrieved from database
Kristoff1875 replied to gavin.sibley's topic in PHP Coding Help
I'm no expert, but maybe you could start a session and then run the query putting the variables in to the session? You can then call on the session variable whenever you want to when the session is open? -
If you right click and view the properties of the image that is broken, what is the address of it?
-
Storing XML values in to PHP session variables?
Kristoff1875 replied to Kristoff1875's topic in PHP Coding Help
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']; ?> -
Storing XML values in to PHP session variables?
Kristoff1875 replied to Kristoff1875's topic in PHP Coding Help
I didn't realise, but it seems I am referencing from old code looking at the comments below!! http://www.html-form-guide.com/php-form/php-order-form.html -
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.
-
Getting data from curl imported XML page?
Kristoff1875 replied to Kristoff1875's topic in PHP Coding Help
That's not displaying anything, just a blank page. -
Getting data from curl imported XML page?
Kristoff1875 replied to Kristoff1875's topic in PHP Coding Help
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? -
Getting data from curl imported XML page?
Kristoff1875 replied to Kristoff1875's topic in PHP Coding Help
You're a genius!!! I love you xxxxxxxxxx -
Getting data from curl imported XML page?
Kristoff1875 replied to Kristoff1875's topic in PHP Coding Help
That returns: Fatal error: Call to undefined function simplexml_load_str() in /home/gdesignz/public_html/Samples/JACK/formaction.php on line 46 -
Getting data from curl imported XML page?
Kristoff1875 replied to Kristoff1875's topic in PHP Coding Help
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? -
Getting data from curl imported XML page?
Kristoff1875 replied to Kristoff1875's topic in PHP Coding Help
I've placed ob_start(); Infront of some of the code, but I just seem to get errors thrown out. Do I need to assign it to a certain function? Sorry, i've not come across this function before! -
Getting data from curl imported XML page?
Kristoff1875 replied to Kristoff1875's topic in PHP Coding Help
I have no idea what how to do it! I'll give it a go now and report back! -
Getting data from curl imported XML page?
Kristoff1875 replied to Kristoff1875's topic in PHP Coding Help
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> -
Getting data from curl imported XML page?
Kristoff1875 replied to Kristoff1875's topic in PHP Coding Help
I'm currently not sure how to get off the XML page that displays after completing the form. -
Getting data from curl imported XML page?
Kristoff1875 replied to Kristoff1875's topic in PHP Coding Help
Thanks again for this, but i'm not quite sure where I should put it? Should it go under the code I posted above which is the formaction.php page that displays the XML result? Thanks -
Getting data from curl imported XML page?
Kristoff1875 replied to Kristoff1875's topic in PHP Coding Help
<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 -
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!