PDA

View Full Version : [PHP] Help!!!



Raskolnikov
12-30-2007, 02:24 AM
I am trying to make a place where you can show your xp gained from scar. I need some help with getting the code to the page. It works, but, the number that prints is always zero. Please help:

Scar Code:

program New;
procedure SendXp;
var xpshareclient: integer;
woodxp, minexp, fishxp, combatxp, fletxp, smithxp: integer;
begin
woodxp := 3;
xpshareclient := InitializeHTTPClient(false, false);
ClearPostData(xpshareclient);
AddPostVariable(xpshareclient, 'Woodcutting', IntToStr(woodxp));
AddPostVariable(xpshareclient, 'Mining', IntToStr(minexp));
AddPostVariable(xpshareclient, 'Fishing', IntToStr(fishxp));
AddPostVariable(xpshareclient, 'Combat', IntToStr(combatxp));
AddPostVariable(xpshareclient, 'Fletching', IntToStr(fletxp));
AddPostVariable(xpshareclient, 'Smithing', IntToStr(smithxp));
PostHTTPPageEx(xpshareclient, 'http://cutem2it.freeweb7.com/xpshare.php');
FreeHTTPClient(xpshareclient);
end;
begin
SendXp;
end.

Php Code:


<?
$Woodcuttingxp = $Woodcuttingxp + Woodcutting;
echo $Woodcuttingxp;
?>

Thanks,
Cut em2 it

Jason2gs
12-30-2007, 03:32 AM
How are you viewing the page? I don't see anything in your SCAR script that prints out the page response once it's done processing. Hitting it from the browser will send no data to the PHP script.

Your PHP script is also a bit messed up. Here's a working version:


<?php
$Woodcuttingxp = $_POST['Woodcutting'];
echo $Woodcuttingxp;
?>

$_POST retrieves a POST variable sent, and $_GET retrieves a GET variable.