I know this is a simple problem, but I have yet to get it working with spaces in the characters name EG. ‘GrimReaper 2012’ comes up as GrimReaper’. the only takes the first set of the name and ignores the rest.
The thing is on the first time it goes through the spaces are fine. On the second on they only show the first part of the character. I know I can simply do and enter each bit manually, but that leads to a lot of entries for said people. Can you please help me.
Here is a link to the working with mySQL (albeit with spaces problem)
http://www.legionofdeath.net/lod/Skiller/update.php
[php]update.php
require(“config.php”);
$title = “Update Characters”;
$submit = $_POST[submit];
echo “
if($submit == “Get Character Information”)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, ‘http://’.$server.’.outwar.com/myaccount.php’);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, ‘login_username=’.$rga_user.’&login_password=’.$rga_pass);
curl_setopt ($ch, CURLOPT_COOKIEJAR, ‘temp/’.$rga_user.‘cookie.txt’);
curl_setopt ($ch, CURLOPT_COOKIEFILE, ‘temp/’.$rga_user.‘cookie.txt’);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
$store = curl_exec ($ch);
curl_setopt($ch, CURLOPT_URL, ‘http://’.$server.’.outwar.com/accounts.php?ac_serverid=’.$server_id);
curl_setopt ($ch, CURLOPT_COOKIEJAR, ‘temp/’.$rga_user.‘cookie.txt’);
curl_setopt ($ch, CURLOPT_COOKIEFILE, ‘temp/’.$rga_user.‘cookie.txt’);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
$store = curl_exec ($ch);
curl_close ($ch);
$charactersinfo = explode(‘Crew’,$store);
$charactersinfo = $charactersinfo[1];
$idinfo = explode(‘world.php?suid=’,$charactersinfo);
$charactersinfo = explode(’’,$charactersinfo);
for ($number = 1; $number < sizeof($charactersinfo); $number = $number + 4)
{
$characternameinfo = explode(’’,$charactersinfo[$number]);
$characternames = $characternames.$characternameinfo[0]."!";
}
for ($number1 = 1; $number1 < sizeof($idinfo); $number1++)
{
$idsinfo = explode(’&serverid=’,$idinfo[$number1]);
$ids = $ids.$idsinfo[0]."!";
}
$ids = explode(’!’,$ids);
$charnames = explode(’!’,$characternames);
echo “
}
elseif($submit == “Update Orbs and Pants.”)
{
echo ‘
$characters = $_POST[‘character’];
for ($number = 0; $number < sizeof($characters); $number++)
{
$info = explode(’!’,$characters[$number]);
$char_name = $info[0];
$char_id = $info[1];
echo ‘<iframe width=-10 frameborder=0 height=-10 src=updatechar.php?charname=’.$char_name.’&charid=’.$char_id.’>’;
}
}
else
{
echo "rawr.
"; } echo "
</div>
[/php]
And this is the second file
[php]
require(“config.php”);
$char_id=$_GET[‘charid’];
$char_name=$_GET[‘charname’];
echo "“;
$result = mysql_query(“SELECT * FROM Character_info WHERE Char_name = ‘$char_name’ AND Char_id = ‘$char_id’ AND RGA_name = ‘$rga_user’ Limit 1”);
if($row = mysql_fetch_array($result))
{
mysql_query(“DELETE FROM Character_skills WHERE Char_id = ‘$char_id’ AND Rga_name = ‘$rga_user’”);
$on1 = 1;
}
else
{
$count = 0;
$result = mysql_query(“SELECT * FROM Character_info WHERE RGA_name = ‘$rga_user’”);
while($row = mysql_fetch_array($result))
{
$count++;
}
}
if($count >= 50)
{
echo ‘’;
}
else
{
if($on1 == 1)
{
//
}
else
{
mysql_query(“INSERT INTO Character_info(‘Char_name’ ,Char_id, RGA_name) VALUES(’$char_name’,’$char_id’,’$rga_user’) “);
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, ‘http://’.$server.’.outwar.com/world.php?suid=’.$char_id.’&serverid=’.$server_id);
curl_setopt ($ch, CURLOPT_COOKIEJAR, ‘temp/’.$rga_user.$char_name.‘cookie.txt’);
curl_setopt ($ch, CURLOPT_COOKIEFILE, ‘temp/’.$rga_user.‘cookie.txt’);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
$store = curl_exec ($ch);
curl_close ($ch);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, ‘http://’.$server.’.outwar.com/equipment.php?id=’.$char_id);
curl_setopt ($ch, CURLOPT_COOKIEJAR, ‘temp/’.$rga_user.$char_name.‘cookie.txt’);
curl_setopt ($ch, CURLOPT_COOKIEFILE, ‘temp/’.$rga_user.$char_name.‘cookie.txt’);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
$store = curl_exec ($ch);
$mainpants = explode(’
$mainpants = explode(’
$mainpants = explode(“removeItem(’”,$mainpants[0]);
$mainpants = explode(”’,”,$mainpants[1]);
$mainpants = $mainpants[0];
$azitems[‘mpants’]=$mainpants;
//echo(“Main Pants:”.$mainpants.”
");
$item_type = “pants”;
$item_id = $mainpants;
curl_setopt($ch, CURLOPT_URL, ‘http://’.$server.’.outwar.com/item_rollover.php?id=’.$item_id);
curl_setopt ($ch, CURLOPT_COOKIEJAR, ‘temp/’.$rga_user.$char_name.‘cookie.txt’);
curl_setopt ($ch, CURLOPT_COOKIEFILE, ‘temp/’.$rga_user.$char_name.‘cookie.txt’);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
$htmlsource = curl_exec ($ch);
//print $htmlsource ."
";
include(‘checkskills.php’);
mysql_query(“UPDATE Character_info SET pants_id = ‘$mainpants’ WHERE Char_name = ‘$char_name’ AND Char_id = ‘$char_id’ AND RGA_name = ‘$rga_user’”);
$orb = explode(’
$orb = explode(’
$orb = explode(“removeItem(’”,$orb[0]);
for ($number1 = 1; $number1 < sizeof($orb); $number1++)
{
$orb1 = explode("’,",$orb[$number1]);
$orbs = $orbs.$orb1[0].’!’;
print $orb1 . “—” . $orbs . “
”;
}
$orbs = explode(’!’,$orbs);
for ($number1 = 0; $number1 < sizeof($orbs) - 1; $number1++)
{
curl_setopt($ch, CURLOPT_URL, ‘http://’.$server.’.outwar.com/equipment.php?rem=’.$orbs[$number1].’&uid=’.$char_id);
curl_setopt ($ch, CURLOPT_COOKIEJAR, ‘temp/’.$rga_user.$char_name.‘cookie.txt’);
curl_setopt ($ch, CURLOPT_COOKIEFILE, ‘temp/’.$rga_user.$char_name.‘cookie.txt’);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
$store = curl_exec ($ch);
}
curl_setopt($ch, CURLOPT_URL, ‘http://’.$server.’.outwar.com/backpack.php?orb=1&id=’.$char_id);
curl_setopt ($ch, CURLOPT_COOKIEJAR, ‘temp/’.$rga_user.$char_name.‘cookie.txt’);
curl_setopt ($ch, CURLOPT_COOKIEFILE, ‘temp/’.$rga_user.$char_name.‘cookie.txt’);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
$store = curl_exec ($ch);
$bporbs1 = explode(‘dropitem[]" value="’,$store);
$bporbs = “”;
for ($number1 = 1; $number1 < sizeof($bporbs1); $number1++)
{
$bporbs2 = explode(’" />’,$bporbs1[$number1]);
$bporbs = $bporbs.$bporbs2[0]."!";
print_r($bporbs2);
print “-----” . $bporbs . “
”;
}
$bporbs = explode(’!’,$bporbs);
for ($number1 = 0; $number1 < sizeof($bporbs) - 1; $number1++)
{
$item_type = "orb";
$item_id = $bporbs[$number1];
curl_setopt($ch, CURLOPT_URL, 'http://'.$server.'.outwar.com/item_rollover.php?id='.$bporbs[$number1]);
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'temp/'.$rga_user.$char_name.'cookie.txt');
curl_setopt ($ch, CURLOPT_COOKIEFILE, 'temp/'.$rga_user.$char_name.'cookie.txt');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
$htmlsource = curl_exec ($ch);
include('checkskills.php');
}
curl_setopt($ch, CURLOPT_URL, 'http://'.$server.'.outwar.com/backpack.php?id='.$char_id);
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'temp/'.$rga_user.$char_name.'cookie.txt');
curl_setopt ($ch, CURLOPT_COOKIEFILE, 'temp/'.$rga_user.$char_name.'cookie.txt');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
$store = curl_exec ($ch);
$bpitems1 = explode('dropitem[]" value="',$store);
$bpitems = "";
for ($number1 = 1; $number1 < sizeof($bpitems1); $number1++)
{
$bpitems2 = explode('" />',$bpitems1[$number1]);
$bpitems = $bpitems.$bpitems2[0]."!";
}
$bpitems = explode('!',$bpitems);
for ($number1 = 0; $number1 < sizeof($bpitems) - 1; $number1++)
{
$item_type = "pants";
$item_id = $bpitems[$number1];
curl_setopt($ch, CURLOPT_URL, 'http://'.$server.'.outwar.com/item_rollover.php?id='.$bpitems[$number1]);
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'temp/'.$rga_user.$char_name.'cookie.txt');
curl_setopt ($ch, CURLOPT_COOKIEFILE, 'temp/'.$rga_user.$char_name.'cookie.txt');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
$htmlsource = curl_exec ($ch);
include('checkskills.php');
}
echo '<body onLoad=add1()></body>';
curl_close ($ch);
}
?>[/php]
These files do work, I just left out a few bits of non-related parts at the start of each.