Jump to content

Need Help To encode String showing in url


budd

Recommended Posts

ok i only know basic code but have been banging my head against a wall for a day or 2 now trying to sort this out this is part of a form from a game site i have after buying something the url shows

 

http://apps.facebook.com/myapp/inventory.php?aid=18&prc=&amt=1&action=buyarms

 

 

<?php

 

$res = query("SELECT * FROM `cu_arms_dealer_list` WHERE `armsType`=1 AND `armsLevel`<=$userLevel ORDER BY armsPrice ASC");

 

while( $row = mysql_fetch_array($res) ) {

echo '<div class=itemBox>';

echo '<TABLE width=100% cellpadding=2 cellspacing=0>';

echo '<tr>';

echo '<td><img src='.$appcallbackurl.'weapons/'.$row[armsImage].' width=100 height=97></td>';

echo '<td width=140><P class=whiteP>'.$row[armsTitle].'</P></td>';

echo '<td width=220><P class=whiteP><span class=attackP>'.$row[armsAttack].'</span> Attack <span class=defenseP>'.$row[armsDefense].'</span> Defense</P></td>';

echo '<td><P class=bigWhiteP>Price: <BR><span class=goldP>'. number_format($row[armsPrice],0) .'</span></P>';

 

$totalOwnByUser = get_total_arms_owned($row[armsId], $user);

echo '<td><P class=titleP>Owned: '.$totalOwnByUser.'</P>';

echo '<P>';

echo '<form fbtype="feedStory" action="'.$appCanvasUrl.'handle_weaponfeed.php">';

echo '<select name=arms_amount>';

echo '<OPTION VALUE="1">1';

echo '<OPTION VALUE="5">5';

echo '<OPTION VALUE="10">10';

echo '</SELECT>';

echo '<input type=hidden name=arms_ID value='.$row[armsId].'>';

echo '<input type=hidden name=arms_Price value='.$row[armsPrice].'>';

echo ' <input type=submit class="submitButton"  name=submit_arms label="Buy" >';

echo '</form>';

echo '</P>';

 

if( $totalOwnByUser > 0 ){

echo '<P>';

echo '<form fbtype="feedStory" action="'.$appCanvasUrl.'handle_weaponsoldfeed.php">';

echo '<select name=arms_sell_amount>';

echo '<OPTION VALUE="1">1';

echo '<OPTION VALUE="5">5';

echo '<OPTION VALUE="10">10';

echo '</SELECT>';

echo '<input type=hidden name=arms_ID value='.$row[armsId].'>';

echo '<input type=hidden name=arms_Price value='.$row[armsPrice].'>';

echo ' <input type=submit class="submitButton" name=submit_sell_arms label="Sell" class="submitButton">';

echo '</form>';

echo '</P>';

}

echo '</td>';

echo '</tr>';

echo '</table>';

echo '</div>';

}

 

 

?>

 

 

i tried encoding '.$row[armsPrice].' and '.$row[armsid].'

it worked but just didnt update the database which i no good  ::)

 

 

any help would be appreciated 

 

 

Budd

here is  the handle_weaponfeed.php code as might be able make the change here

 

<?php

require_once 'appinclude.php';
require_once 'lib/config.php';
require_once 'lib/userinc.php';
require_once 'lib/crewinc.php';
require_once 'lib/weaponinc.php';
require_once 'lib/transportinc.php';
require_once 'lib/jobinc.php';
require_once 'lib/fightinc.php';
require_once 'lib/assetinc.php';
require_once 'lib/bankinc.php';
include ('JSON.php');


$json = new Services_JSON();

$armsName = get_arms_name($_POST[arms_ID]);
$armsImage = get_arms_image($_POST[arms_ID]);

// FEED DATA
$feed = array('template_id'=>$FeedID04,
			  'template_data'=>array('appname'=>$appTitle,
									 'appurl'=>$appCanvasUrl,
									 'armsname'=>$armsName,
									 'armsamount'=>$_POST[arms_amount],
									 'images'=>array(array('src'=>$appcallbackurl.'weapons/weapon.gif',
    	                           								'href'=>$appCanvasUrl),
											array('src'=>$appcallbackurl.'weapons/weapon1.gif',
					                              'href'=>$appCanvasUrl),
											array('src'=>$appcallbackurl.'weapons/weapon2.gif',
					                              'href'=>$appCanvasUrl),
											array('src'=>$appcallbackurl.'weapons/weapon3.gif',
					                              'href'=>$appCanvasUrl),
											array('src'=>$appcallbackurl.'images/joinnow.png',
					                              'href'=>$appCanvasUrl))							
							)
		);


$publish = array('method'=> 'feedStory', 
    	  	         'content' => array( 'feed' => $feed, 
                     		             'next' => $appCanvasUrl.'inventory.php?aid='.$_POST[arms_ID].'&prc='.$_POST[arms_Price].'&amt='.$_POST[arms_amount].'&action=buyarms'));

echo $json -> encode($publish);


?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.