PHP - Converting An Incoming Post/encoded Sting From Another Domain.
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). Code: [Select] $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.... Similar TutorialsHello
I have a nusoap web service running, which is fine, but I need to send a new variable in the parameters which decides what database to use...
This is how I call the function:
$params = array( 'region' => '1' ); $response1 = $client->call('function1', array ($params)); // response will be in JSON Hello all, I have this issue: I have a form with several fields. I need to save to a session variable (in submit page) all of the fields upon submit and then post some of the fields to a https site using a POST request (i.e., doing a header('Location: https://mynewdomain.com/page.cfm?'.$data) won't cut it). Now, I can do it with javascript... a whole bunch of hidden fields in the between page and then auto submit the form to the mynewdomain.com domain using the post method. I am wondering whether there would be a better way for that. I know that Curl does it, with one glitch. When I set the parameter CURLOPT_FOLLOWLOCATION to true it redirects the user BUT it doesn't load any css or javascript from the new page. People say on the web to do a request for each file but I haven't figured out how to do it. Can anyone post an elegant/concrete solution to this problem or should I resort to Javascript? Thanks menwn I have an audit trail that record users ids and a copy of the sql string for any updates they make to my application. This is very easy for me to follow to find exactly where changes happened but do end users it is a bit of a challenge. Has anyone seen or made a script that can either compare two sql strings to see what fields have different values or a script that takes an SQL string and outputs its field names and values to an array that I can use for comparisons? Example being the look at a update made by user X, the database pulls the sql for that change then looks for the previous change up any user before (update sql should have a value for all fields) then compares to see what user X changed. If not im thinking of case statement to divide sql request between inserts and update then writing a script to split the strings based on where the commas were. Any thoughts? Hello
I am looking for a way to log all incoming requests to a nusoap web service to a file.. any suggestions?
Thanks
I am running a godaddy linux server and would like to save the incoming emails into my database. I'm running a Simple Control Panel. This article about intercepting emails is exactly what I want to do. But its not working... http://tinsology.net/2009/01/intercepting-email-with-php/ It looks like there are quite a few pointers online but i haven't found a solution. Thanks in advance. Ahoy Sailor! So I've just started making a Server Client based application in PHP, First time I've dabble in PHP for about a year so forgive me if I'm slightly rusty. But I get the "Could not accept incoming connection" error when my client try's to connect to my server. How cometh? <?php $host = "127.0.0.1"; $port = 405; set_time_limit(0); // create socket $socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create socket\n"); $result = socket_bind($socket, $host, $port) or die("Could not bind to socket\n"); $result = socket_listen($socket, 3) or die("Could not set up socket listener\n"); // Networking area, Creating, Binding & finally listing $spawn = socket_accept($socket) or die("Could not accept incoming connection\n"); $out = "0;text\n"; socket_write($spawn, $out, strlen ($out)) or die("Could not write output\n"); ?> ^ Client<?php $addr="127.0.0.1"; $port=405; $timeout=0; $socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create socket\n"); $res = socket_connect($socket, $addr, $port); $spawn = socket_accept($socket) or die("Could not accept incoming connection\n"); $dat= socket_read($spawn, 1024) or die("Could not read input\n"); echo $dat; ?> Server^ _____________________ Anyone know? See Ya! I am having problems with these slashes. They keep showing up when I echo data.... The code is to update a field in a mysql database table. Here is my code: Code: [Select] $query = mysql_query("SELECT * FROM `bus` WHERE username='$username'"); $row = mysql_fetch_array($query); $bio = $row['about']; $bio = str_replace("<br />","\r\n",$bio); if(isset($_POST['submit'])){ if(empty($errors)){ if($password == $pass){ $about1 = mysql_real_escape_string($_POST["about"]); $about1 = str_replace("\r\n","<br />",$about1); mysql_query("UPDATE bus SET about='$about1' WHERE username='$username'"); }else{$errors[] = 'Incorrect Password';} } } When I run this and put: About: I'm very tired today It's been very hard I get the about1 string as: I\\\'m very tired today\r\nIt\\\'s been very hard Why??? Hello, I am trying to export data from database. the exported data is creted with wrong encoding. I am using this code: header("Pragma: public"); header('Expires: '.gmdate('D, d M Y H:i:s').' GMT'); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); header("Content-Type: application/force-download;charset=utf-8; encoding=UTF-8"); header('Content-Disposition: attachment; filename="'.$newFile.'"'); header("Content-Transfer-Encoding: binary"); header('Content-Length: '.@filesize($path)); Please help with the encoding. Thanks. This topic has been moved to the corner of 3rd Avenue and mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=359430.0 I have two domains both running SSL. Let's call them old-domain and new-domain. old-domain is permanently redirecting traffic to new-domain. There are still a lot of links out there to old-domain with https://. If I were to remove SSL from old-domain but keep SSL on new-domain, I am betting that users will be getting some sort of certificate error. Right? Any way around that if I want to remove SSL from old-domain?
Hi guys, I'm parsing a bunch of html sources, some of them (a minority) contain base64 encoded URLs. At least 20-30 URLs per page. Some of the information I need is taken from the URLs. I'm looking for a way to parse these URLs without losing too much time (20-30 URLs per page and I need to parse about 10k pages daily). Should I regex each source individually for base64 encoded URLs and then decode them each time and isn't that going to take a lot of time/resources (especially considering it's only a minority that have the base64 URLs in them)? Or is there a better way to do it? Code snippets are absolutely welcome! Thank you in advance so I've been putting all of my php scripts to exe to protect some of the code I have written, say I write a simple loop script like below <?php $REPEAT = 1000; $ECHO = "CLUEL3SS"; for($cwb=1; $cwb!=$REPEAT; $cwb++) { echo "#$cwb: $ECHO\n"; } sleep(99999999); ?> Now how can I set the variable $REPEAT when the script is in .exe form and I cannot edit the code I have tried $REPEAT = fgets(STDIN); That doesnt seem to work though when I have 5+ variables to assign and I have an array set like like $Variable[] = 12345799; $Variable[] = 34324555; $Variable[] = 34289789; $Variable[] = 32899090; How can I use a text file to set these options? maybe have the variables assigned in a text file like Code: [Select] ; this is a comment, this will be ignored REPEAT : 1000 ; this is another comment, ignored also... ECHO : CLUEL3SS ; comment Variable : 3423423 Variable : 2903890 Variable : 3948903 Variable : 9823900 How would I have the php script read the text file in that format to set the variables? How can i check if a string is URL encoded or not using PHP Hello all, I have a script I have been working on that retrieves my email from my mail server using some of the imap_functions. Everything works fine except for the emails that were sent from my blackberry. I have done some research and it seem to be something to do with the encoding that the blackberry uses. I have found a little bit of code that I was hoping would solve the issue. My goal is to get the body content from email that was produced with my blackberry and put bits of this body into a database. Then I want to do a report from that database once a week. I have developed a script that will retrieve all other message except from my blackberry. Does anyone know how blackberry encodes their body content? jmr3460 Hey guys, I have a script that attempts to call the database of my forums to find the last games played on each of their xbox live profiles. However when it attempts to call the image, it encodes the url - so http://tiles.xbox.com/tiles/tT/MX/0mdsb2JgbA9ECgQJGgYfVlpWL2ljb24vMC84MDAwIAABAAAAAP04M6o=.jpg turns into http%3A%2F%2Ftiles.xbox.com%2Ftiles%2FtT%2FMX%2F0mdsb2JgbA9ECgQJGgYfVlpWL2ljb24vMC84MDAwIAABAAAAAP04M6o%3D.jpg which makes the URL not work anymore so the script gives an error. I've tried urldecode() on numerous variables and it won't work. If I call the variable for the image on the page that submits the form it returns a normal address. Anyone have any ideas? Thanks! <?php // rss page - $feed_url = "http://blog.kyleramirez.com/feed/"; // Load XML. $xml = simplexml_load_file($feed_url); // How many items to display from the RSS Feed ... $count = 3; // Grabbing the NameSpace URI for "itms" and "content" ... foreach ($xml->channel->item as $item) { $ns_content = $item->children('http://purl.org/rss/1.0/modules/content/'); if($count > 0){ echo " <ul class=\"pageitem\"> <li class=\"textbox\"><span class=\"header\">{$item->title}</span> {$ns_content->encoded} </li> <li class=\"menu\"> <span class=\"name\"><a href='{$item->link}'>View</a></span></li></ul> "; }else{ Return; } $count--; } ?> Above is a snippet of code used to extract the content:encoded and title from my RSS feed. I am looking for a way to strip the content part of a few tags, namely style and size and width tags so that I can fit it into the mobile section of my website. The mobile site is m.kyleramirez.com. You will be able to see how the rss feed is implemented there. This shouldn't be that complicated. I was trying to the str_replace to do it but I'm not sure how to put it in there. Any ideas? {$ns_content->encoded} is where the entire post is showing up. How do I add a str_replace to that? Friends, I developed a script in php & i tested the script before encoding & its working fine. After i encoded the script through ionCube PHP Encoder & uploaded in my server but the file shows only blank page. Its not executing after encoding. What is the problem ?? How to fix it ? I have an array $array_1 Code: [Select] ARRAY( [0] => info 1 [1] => info 2 [2] => info 3 ) and I have another array $array_2 Code: [Select] ARRAY( [0] =>thank you and welcome to what ever [1] =>the info you added * thanks for entering your info ) I want to loop though the first array and place the values into the [1] of the second array. But the tricky thing is I want it to insert were the * is. Code: [Select] foreach ($array_1 as $key => $val) { //not sure about this insert into ($array_2[1],after *, $val); } any help would be awesome. Trying to get this done: Page_1 has many external links, when certain links are clicked i do not want user to go directly to page, but rather go to a special add page_2 where user must click a second time on the link to finally get there. The add page_2 must show on screen the name of the initial link from page_1, it must change accordingly with the link it came from page_1,once on page_2 the hyperlink redirects outside the site. So far i am thinking give an id to the div or "<a href..." on page_1 then somehow have page_2 detect that id and fill in the variable for the final external link. Other wise is there a way to detect a url from incoming? I guess a similar example is how some domain name sellers landing page will indicate the name of the site. Such as "Thisdomain.com" is for sale. same landing page but the name changes according to the domain that was typed. |