Jump to content

nine72

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

About nine72

  • Birthday 06/07/1969

Contact Methods

  • MSN
    nine.72@hotmail.com

Profile Information

  • Gender
    Male
  • Location
    Addison TExas

nine72's Achievements

Member

Member (2/5)

0

Reputation

  1. requinix, if figured out what is going on with it FINALLY. Here is what's happening... When the request is passed to their domain there are 2 url's being passed to them. 1) a response url - this is where their cURL is sending the response information and it is a php script page directly on the server and NOT connected to any other pages, no redirects, no session set up etc. It reads the incoming as $_REQUEST and then tosses it (somewhere, I have no figured out that part yet). 2) redirect url - this url is set up after the cURL is closed as a header redirect on their side and redirects the uses browser to a given page, in this case one that just tells the user that their record has been added, and provides no details of the response. So that is why I could not grab any of the response data - Oh and btw, this is not my code, looks like I am maybe #5 working with it over the years. Thanks for the looks and the help.
  2. Hey everyone... Been over a year or more since I have had seek help here but I have something that I just do not understand. I am submitting a from from one domain - www.mydomain.com - to a form handler on another domain - www.theirdomain.com all under https. The form data is getting to theridomain.com just fine, the other side is handling it properly and all is well there. The issue is they are taking the response they generate and shipping it out via cURL using the below (they were nice enough to share this with me). $url = $_SESSION['request']['retUrl']; $fields = array( 'hash'=>rawurlencode($hash), 'responseText'=>rawurlencode($_SESSION['response']['responseText']), 'cid'=>rawurlencode($_SESSION['request']['cid']), 'name'=>rawurlencode($_SESSION['request']['name']), 'actCode'=>rawurlencode($_SESSION['response']['actCode']), 'apprCode'=>rawurlencode($_SESSION['response']['applCode']), 'Token'=>rawurlencode($_SESSION['response']['token']), 'req_number'=>rawurlencode($_SESSION['request']['req_number']), ); foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } rtrim($fields_string,'&'); if (isset($_SESSION['request']['Address1'])) { $Address = array( 'Address1'=>rawurlencode($_SESSION['request']['Address1']), 'Address2'=>rawurlencode($_SESSION['request']['Address2']), 'City'=>rawurlencode($_SESSION['request'][City']), 'State'=>rawurlencode($_SESSION['request'][state']), 'Zip'=>rawurlencode($_SESSION['request']['Zip']), 'Country'=>rawurlencode($_SESSION['request']['Country']), ); foreach($Address as $key=>$value) { $Address_string .= $key.'='.$value.'&'; } rtrim($Address_string,'&'); } $end = array( 'END'=>"END" ); foreach($end as $key=>$value) { $end_string .=$key.'='.$value; } rtrim($end_string,'&'); I have worked for almost a week and I CANNOT snag the incoming data! All I am trying to do is collect this and convert it into $_SESSION data for use on a success page. If any one has any thoughts or in site, please....
  3. Hey guys, been awhile since I have been here, but I hit a little issue in reading session data reliably every time. What I am doing is reading the variables and values from a rarurlencoded string. Then putting that into a session array to populate parts of a form and fill in some hidden fields. After the form posts every now and then, about 1 in 50 or so attempts, I have one (always the same one) that just vanishes. Anyone ever experience anything like this?
  4. AHhhhhh, I will give this a shot and let you know how it rolls. Thank You cags!
  5. I am not sure exactally what you mean so bear with me... Do you mean that on the form from the first domain set it with a target id some thing like" <form name="test" method="post" target="partner" action="iframe_test.php"> and then set the iframe with <iframe src="http://other.domain.iframe.com" id="partner" width="500" height="350" frameBorder="0"></iframe> or something like that?
  6. I have tried to use .js and converting the session information to a hidden from and do a "POST" to the iframe using an onLoad. This works but it breaks the iframe and loads the partner page directly. Wonder if I should find a js forum and see if there is some way to us js and hold the iframe inplace....or if it is possible to post the original form information to 2 urls. I was hoping that I could take the $_SESSION variables and encode them to the url that calls the iFrame and then decode them for that page in the iframe and use them that way....but I cant get that to work ether. (Granted I have never done encoding like that before so I may just be missing something... ) I think that this would be acceptable since none of the information being sent is sensitive...
  7. Hey everyone...been awhile since I have been here but I have hit a roadblock that I cant seem to get past and I am sure that it is something simple. I have a form page that is more or less a user registration page. Collects: First Name Last Name Address .... From here I am posting to another page on my domain, but it calls an iFrame that loads from another domain. In my posting of the form data I am converting it to $_SESSION information and I need to pass that to this page from the other domain and I just cant figure it out... EXAMPLE: Form Page (only "hidden" because did not want to build all the fields to test) <form name="test" method="post" action="iframe_test.php"> <input type="submit" name="Submit"/> <input type="hidden" name="fName" value="ABC" /> <input type="hidden" name="lName" value="DEF" /> <input type="hidden" name="address1" value="GHI" /> <input type="hidden" name="address2" value="JKL" /> <input type="hidden" name="country" value="MNO" /> <input type="hidden" name="postal_code" value="PQR" /> <input type="hidden" name="city" value="STU" /> </form> From here the iframe_test.php page loads and I can do print_r ($_SESSION); and can see that the values have been passed to this page and the page loads the iframe just fine.. <body> <div align="center"><span class="style1"><strong>This is the iFrame Page</strong></span> </div> <div align="center"> <iframe src="http://other.domain.iframe.com" width="500" height="350" frameBorder="0"></iframe> </div> </body> I need to some how move the $_SESSION data to the http://other.domain.iframe.com domain. Mainly the reason for this is that it is a second registration at a partner site, and I am just trying to keep the user from having to re-enter their details....just trying to be user friendly a bit.....a bit. Any thoughts, suggestions, would be helpful....Oh and I have considered doing a urlencode but have not been able to make that work ither. Thanks!
  8. Thanks for the replies, I have just done a test and used unset only, and it worked kind of...one of my reusable form sets still retained the previous information but only in fire fox...weird... but I think that it will work out fine... Thanks again. How do i close this or mark it answered?
  9. Hey everyone, Is it possible to unset and destroy a named session...example: $_SESSION['form_data'] ??? I have 23 named session states including my orginal login session ($_SESSION()) I need to unset and destory the other 22 with out loosing the login session. I know that I can unset the named session by unset($_SESSION['form_data']); Thanks in advance...
  10. wildteen88, I...I...don't know what to say....that is beautiful! I had been printing to the array out to the page using... //Creating Instance of the Class $xmlObj = new XmlToArray($xml_data); //Creating Array $arrayData = $xmlObj->createArray(); it is that last line you supplied that I could not figure out... // save the generated array to the $_SESSION variable $_SESSION['xmlResponse'] = $xml_array['xml']['Response']; I can not beleive that it is that simple...I must have been over thinking...because nothing about this first phase of this project has been THAT easy for a year now... I think that I shall consider you a php God .... I will set this up and run with it...if I can make it all work I can move to phase 2...w00t Thank you again!
  11. Sorry about not being really clear on some of this wildteen88 but you did answer part of my problem and I thank you. I had it in my mind that it was going to be way more complicated than that…I think because I have not been able to figure out how to access and use [ResponseText] => Succeed as an actual variable that I can use from the parse. The rest of the problem is that I parse the response, but I need to take the results that I get from the parse and move them in to the named session i.e. $_SESSION[‘xmlResponse’] Example Parse Results – Array ( [xml] => Array ( [Response] => Array ( => Array [ResponseText] => Succeed [contact_id] => 677 [r_contact_type] => DEFAULT [r_first_name] => JOHN Turn into – $_SESSION[‘xmlResponse’][‘ResponseText’] = “Succeed”; $_SESSION[‘xmlResponse’][‘contact_id’] = “667”; $_SESSION[‘xmlResponse’][‘r_contact_type’] = “DEFAULT”; $_SESSION[‘xmlResponse’][‘r_first_name’] = “JOHN”; Etc… Kind of like when I am doing a POST from form page to form page I take the incoming POST and do foreach ($_POST as $key => $val) { $_SESSION['form_data'][$key] = $val; } Then do as you suggest and access the $_SESSION[‘xmlResponse’] via session_start() on the Complete Page. On the complete page I need to take the $_SESSION[‘xmlResponse’] values and print them in an organized manner for the user to print out, save etc…
  12. First I want the thank everyone for the fantastic help I have received here. You all have been excellent! I am to the final stages of the project that I am working on, and I have one last issue that I am struggling with…. ??? I am getting back an xml string from the middleware app that I post my xml string to. This string is a string and not a file. (I am working with a test "file" at the moment and may need some help reading the actuall sting... ) Anyway the string comes in and I can get it into an associative array so that is good. What I need some help with is remove some tags that I do not need and then turn this array to a named session array and automatically post to another page. partial example of the parsed xml array as it is now… Array ( [xml] => Array ( [Response] => Array ( => Array ( [ResponseText] => Succeed [contact_id] => 677 [r_contact_type] => DEFAULT [r_first_name] => JOHN [r_last_name] => DOE [r_middle_i] => B [r_address1] => 100 SOME ST [r_address2] => SUITE 180 [r_state_cd] => TX [r_city] => DALLAS [r_zip] => 75287 [r_cntry_cd] => 840 [r_telephone] => 9879879877 [r_mobile] => [r_email_id] => JOHN@MAIL.COM [r_department] => [r_title] => [r_fax] => 3213213211 [r_url] => [r_country] => UNITED STATES OF AMERICA [r_state] => TEXAS [r_customer_care_phone] => 9879879877 [r_copy_to_accounting] => [r_copy_to_billing] => [r_copy_to_chargeback] => [r_copy_to_helpdesk] => [r_copy_to_management] => [r_copy_to_technical] => [r_apply_to_cp] => [r_apply_to_mm] => [r_apply_to_me] => [r_apply_to_tt] => [contact_type] => ACCOUNTING [first_name] => JANE [last_name] => DOE [middle_i] => M [address2] => [state_cd] => MA [city] => RIVERMORE [zip] => 01556 [cntry_cd] => 840 [telephone] => 9879879877 [mobile] => [email_id] => JANE@MAILME.COM [department] => [title] => [fax] => 3213213211 [url] => [country] => UNITED STATES OF AMERICA [state] => MASSACHUSETTS [customer_care_phone] => 9879879877 [copy_to_accounting] => [copy_to_billing] => [copy_to_chargeback] => [copy_to_helpdesk] => [copy_to_management] => [copy_to_technical] => [apply_to_cp] => [apply_to_mm] => [apply_to_me] => [apply_to_tt] => ) ) => > ) ) Put into a named session of $_SESSION[‘xmlResponse’]['$key'] = $val; And based on [ResponseText] => val Send to ether a “Complete” page or a “Failed” page. This is the parse class that I am using.... <?PHP /** * XMLToArray Generator Class * Purpose : Creating Hierarchical Array from XML Data */ class XmlToArray { var $xml=''; /** * Default Constructor * @param $xml = xml data * @return none */ function XmlToArray($xml) { $this->xml = $xml; } /** * _struct_to_array($values, &$i) * * This adds the contents of the return xml into the array for easier processing. * Recursive, Static * * @access private * @param array $values this is the xml data in an array * @param int $i this is the current location in the array * @return Array */ function _struct_to_array($values, &$i) { $child = array(); if (isset($values[$i]['value'])) array_push($child, $values[$i]['value']); while ($i++ < count($values)) { switch ($values[$i]['type']) { case 'cdata': array_push($child, $values[$i]['value']); break; case 'complete': $name = $values[$i]['tag']; if(!empty($name)){ $child[$name]= ($values[$i]['value'])?($values[$i]['value']):''; if(isset($values[$i]['attributes'])) { $child[$name] = $values[$i]['attributes']; } } break; case 'open': $name = $values[$i]['tag']; $size = isset($child[$name]) ? sizeof($child[$name]) : 0; $child[$name][$size] = $this->_struct_to_array($values, $i); break; case 'close': return $child; break; } } return $child; }//_struct_to_array /** * createArray($data) * * This is adds the contents of the return xml into the array for easier processing. * * @access public * @param string $data this is the string of the xml data * @return Array */ function createArray() { $xml = $this->xml; $values = array(); //$index = array(); $array = array(); $parser = xml_parser_create(); xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); xml_parse_into_struct($parser, $xml, $values); //, $index xml_parser_free($parser); $i = 0; $name = $values[$i]['tag']; $array[$name] = isset($values[$i]['attributes']) ? $values[$i]['attributes'] : ''; $array[$name] = $this->_struct_to_array($values, $i); return $array; }//createArray }//XmlToArray ?> So any assistance would be out standing! Thanks so much everyone… nine
  13. my query statement, held on an include page... $xmlSet = 'SELECT * FROM table_name'
  14. Hi everyone, Just a question if you will... I have a set of forms (8 to be exact) I am saving the field data to the session, then generating a massive, very complex XML string based on the data in the session. EXP...for simplest part of the xml build. $xmlString .= "<Corporate>\n"; $xmlString .= "<CpBus>\n"; $xmlString .= "<agent_id>". $agentId ."</agent_id>\n"; $xmlString .= "<iso_id>". $isoId . "</iso_id>\n"; $xmlString .= "<bb_id>". $bbId . "</bb_id>\n"; $xmlString .= "<cp_legal_name>". $cpLegalName . "</cp_legal_name>\n"; $xmlString .= "<cp_dba_name>". $cpDbaName . "</cp_dba_name>\n"; $xmlString .= "</CpBus>\n"; $xmlString .= "</Corporate>\n"; Moving forward I do not want to save to the session as I need 3 of the forms to be able to be used over and over by the user as many times as needed. Therefore, I am now committing the data to a mysql temp db. At the point I want to build my XML string I want to pull the information from the tables and place into a session, just long enough to build the string. The session build needs to look something like this: $_SESSION['column_name'] = $val_of_cell; So I am thinking that it should be as simple as... include_once("../../Connections/bdadd.php"); // Location of my db connection script include_once("../../db_calls/get_session.php"); // Location of my query to get table data. $xmlSet = 'SELECT * FROM table_name' $query = ($xmlSet); $res = mysql_query($query); if($res){ while($row = mysql_fetch_assoc($res)){ foreach($row as $key => $val){ $_SESSION[$key] = ($val); } } } Change to the xml generation would be something like… $xmlString .= "<Corporate>\n"; $xmlString .= "<CpBus>\n"; $xmlString .= "<agent_id>". $agentId ."</agent_id>\n"; $xmlString .= "<iso_id>". $isoId . "</iso_id>\n"; $xmlString .= "<bb_id>". $bbId . "</bb_id>\n"; $xmlString .= "<cp_legal_name>". $cpLegalName . "</cp_legal_name>\n"; $xmlString .= "<cp_dba_name>". $cpDbaName . "</cp_dba_name>\n"; $xmlString .= "</CpBus>\n"; $xmlString .= "</Corporate>\n"; To accommodate the session set up. However, when I try and test this theory by doing a echo "<pre>"; print_r(session_id()); print_r("\n"); print_r($_SESSION); echo "</pre>"; I get the session_id but none of the data from the table.... Does anyone have any thoughts, theories or suggestions? Thanks
×
×
  • 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.