RE: Posting directly to the database newsgroup question

From: Date: Tue, 06 Apr 2004 22:08:43 +0000
Subject: RE: Posting directly to the database newsgroup question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-182556@lists.php.net to get a copy of this message
Rob, here's some pointers: The 'client' creates a URL of the type: http://myserver.com/index.php?val1=foo&val2=bar Then the 'server' just dumps the values in accordingly. Now what I suggest is you do this on the client side: $GetData = base64_encode(serialize($GetData)); if ($DEBUG) echo "\n".SERVER."?data=".$GetData."\n"; if ( !(@fopen(SERVER."?data=".rawurlencode($GetData), "r")) ) { if ($DEBUG) echo "Could not connect to ".APPLIANCE_SERVER."\n"; } else if ($DEBUG) echo "\ncompleted.\n"; And this on the server side: $GetData = unserialize(base64_decode($_GET['data'])); $dataArray = explode("&",$GetData); //print_r($dataArray); foreach($dataArray as $k => $v) { if ($DEBUG) echo "k: $k => v: $v<BR>\n"; list($key, $val) = explode("=", $v); if ($DEBUG) echo "key: $key => val: $val<BR>\n"; if ($val != "") $sku_appliance[$key] = $val; } ________________________________ Daevid, You are doing exactly what I'm WANTING to do. I want to have a URL, that when clicked on, will update info in our mySQL database with the variables supplied in the URL. From your post on the database newsgroup, it seems you have done this very thing. Can you give me a quick example on how it was done? Thanks. Rob

« previous php.general (#182556) next »