![]() |
|
#1
|
||||
|
||||
![]()
okay I take it back, had to refresh several times, now no error!
Still isnt taking the money out though ... oh Ill try that, thanks!! I'm not sure what to edit there -- well no more syntax error, and it IS showing the "give a nice message" thing! Just no transfer of the money ... |
#2
|
||||
|
||||
![]()
Yeah, it said 123 :P Since I can't open up the file myself and edit it, then I can't speed up the process on fixing it. xD
|
#3
|
||||
|
||||
![]()
no more syntax prob, it's coming up fine! I am trying to help think too what would be causing the failure to take from the one, and then give to the new one ----
|
#4
|
||||
|
||||
![]()
Maybe change the some of the code back to:
$query = "UPDATE ".$prefix."users SET money='".$cashs."' WHERE username='".$loggedinname."'"; and $query = "UPDATE ".$prefix."users SET money='".$cashs2."' WHERE username='".$user."'"; :/ I'm not really sure. |
#5
|
||||
|
||||
![]()
I'll try that, and thank you so much for working on this for me, I really appreciate it very much! :D :D
I am sure it's really close, likely just one thing is messing it up :) I'll keep you posted, and yeah, from what I can tell, it really ought to be working, so I'll go over it with a fine tooth comb hehehe -- just baffled why it isn't working, possibly the form isn't inputting what we need it to?[hr] Okay update, lol. Using that code above: Code:
$query = "UPDATE ".$prefix."users SET money='".$cashs."' WHERE username='".$loggedinname."'"; mysql_query($query); $query = "UPDATE ".$prefix."users SET money='".$cashs2."' WHERE username='".$user."'"; It took all the money out of the sending user ( loggedinname ) and put it to 0---and did not add any to the receiver -- but at least it's doing something ! This is possibly a clue?? |
#6
|
||||
|
||||
![]()
On a project I'm working on, it does that to me all the time! ( X.X ) Could you post the entire file please? ( givemoney2.php ) Thanks.
|
#7
|
||||
|
||||
![]()
sure!
givemoney2.php: Code:
<?php // ********************************************************************** // Rusnak PHP Adoptables Script // Copyright 2009 Brandon Rusnak // For help and support: http://www.rusnakweb.com/forum/ // // Redistribution prohibited without written permission // ********************************************************************** // Wake the sleeping giant // ********************************************************************** // Basic Configuration Info // ********************************************************************** include("inc/functions.php"); include("inc/config.php"); include("lang/lang.php"); $themeurl = grabanysetting("themeurl"); // ********************************************************************** // Define our top links by calling getlinks() // ********************************************************************** $links = getlinks(); // ********************************************************************** // Define our ads by calling getads() // ********************************************************************** $ads = getads("account"); // ********************************************************************** // Grab any dynamic article content from the content table // ********************************************************************** $article_title = $pagecontent[title]; $article_content = $pagecontent[content]; $article_content = nl2br($article_content); // ********************************************************************** // Grab any settings that we will need for the current page from the DB // ********************************************************************** $browsertitle = grabanysetting("browsertitle"); $sitename = grabanysetting("sitename"); $slogan = grabanysetting("slogan"); // ********************************************************************** // Check and see if the user is logged in to the site // ********************************************************************** $loginstatus = logincheck(); $isloggedin = $loginstatus[loginstatus]; $loggedinname = $loginstatus[username]; // ********************************************************************** // End Prepwork - Output the page to the user // ********************************************************************** if($isloggedin == 'yes') { $user = $_GET["user"]; $user = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $user); $user = secure($user); $gm = $_GET["gm"]; $gm = secure($gm); $query = "SELECT * FROM ".$prefix."users WHERE username = '$loggedinname'"; $result = @mysql_query($query); //Loop out code $i=0; while ($i < 1) { $money=@mysql_result($result,$i,"money"); $i++; } $query = "SELECT * FROM ".$prefix."users WHERE username = '$user'"; $result = @mysql_query($query); //Loop out code $i=0; while ($i < 1) { $money2=@mysql_result($result,$i,"money"); $i++; } $cashs = $cash - $gm; $cashs2 = $cash2 + $gm; if($gm <= $cash){ $query = "UPDATE ".$prefix."users SET money='".$cashs."' WHERE username='".$loggedinname."'"; $query = "UPDATE ".$prefix."users SET money='".$cashs2."' WHERE username='".$user."'"; mysql_query($query); $article_content = "[Not active yet!]"; } } // ********************************************************************** // Begin Template Definition // ********************************************************************** //Define our current theme $file = $themeurl; // Do the template changes and echo the ready template $template = file_get_contents($file); $template = replace(':ARTICLETITLE:',$article_title,$template); $template = replace(':ARTICLECONTENT:',$article_content,$template); $template = replace(':ARTICLEDATE:',$article_date,$template); $template = replace(':BROWSERTITLE:',$browsertitle,$template); $template = replace(':SITENAME:',$sitename,$template); //Define our links $template = replace(':LINKSBAR:',$links,$template); //Get the content for the side bar... $sidebar = getsidebar(); $template = replace(':SIDEFEED:',$sidebar,$template); //Get the ad content... $template = replace(':ADS:',$ads,$template); //Get the slogan info $template = replace(':SLOGAN:',$slogan,$template); echo $template; // ********************************************************************** // End Template Definition // ********************************************************************** ?> And then givemoney.php : Code:
<?php // ********************************************************************** // Rusnak PHP Adoptables Script // Copyright 2009 Brandon Rusnak // For help and support: http://www.rusnakweb.com/forum/ // // Redistribution prohibited without written permission // ********************************************************************** // Wake the sleeping giant // ********************************************************************** // Basic Configuration Info // ********************************************************************** include("inc/functions.php"); include("inc/config.php"); $themeurl = grabanysetting("themeurl"); // ********************************************************************** // Define our top links by calling getlinks() // ********************************************************************** $links = getlinks(); // ********************************************************************** // Define our ads by calling getads() // ********************************************************************** $ads = getads("any"); // ********************************************************************** // Grab any dynamic article content from the content table // ********************************************************************** $pagecontent = getsitecontent("index"); $article_title = $pagecontent[title]; $article_content = $pagecontent[content]; $article_content = nl2br($article_content); // ********************************************************************** // Grab any settings that we will need for the current page from the DB // ********************************************************************** $browsertitle = grabanysetting("browsertitle"); $sitename = grabanysetting("sitename"); $slogan = grabanysetting("slogan"); // ********************************************************************** // Check and see if the user is logged in to the site // ********************************************************************** $loginstatus = logincheck(); $isloggedin = $loginstatus[loginstatus]; $loggedinname = $loginstatus[username]; // ********************************************************************** // End Prepwork - Output the page to the user // ********************************************************************** if($isloggedin == 'yes'){ $article_content = "<FORM METHOD='POST' ACTION='givemoney2.php'> Give to User:<input name='user' type='text' id='user'><br> Amount to Give:<input name='gm' type='text' id='gm'> <INPUT TYPE='submit' VALUE='Give Money'> </FORM>"; } else{ $article_content = "[Display Some Nice Message to the Guest]"; } // ********************************************************************** // Begin Template Definition // ********************************************************************** //Define our current theme $file = $themeurl; // Do the template changes and echo the ready template $template = file_get_contents($file); $template = replace(':ARTICLETITLE:',$article_title,$template); $template = replace(':ARTICLECONTENT:',$article_content,$template); $template = replace(':ARTICLEDATE:',$article_date,$template); $template = replace(':BROWSERTITLE:',$browsertitle,$template); $template = replace(':SITENAME:',$sitename,$template); //Define our links $template = replace(':LINKSBAR:',$links,$template); //Get the content for the side bar... $sidebar = getsidebar(); $template = replace(':SIDEFEED:',$sidebar,$template); //Get the ad content... $template = replace(':ADS:',$ads,$template); //Get the slogan info $template = replace(':SLOGAN:',$slogan,$template); echo $template; // ********************************************************************** // End Template Definition // ********************************************************************** ?> |
#8
|
||||
|
||||
![]()
How could I have made that happen?
Here's a "fixed" version of givemoney2.php: PHP Code:
|
#9
|
||||
|
||||
![]()
oh cool!! Let me go try that, thanks again so much, I'll let you know what happens!! <3[hr]
it WORKS!! Here is the code that finally worked: givemoney2.php: Code:
<?php // ********************************************************************** // Rusnak PHP Adoptables Script // Copyright 2009 Brandon Rusnak // For help and support: http://www.rusnakweb.com/forum/ // // Redistribution prohibited without written permission // ********************************************************************** // Wake the sleeping giant // ********************************************************************** // Basic Configuration Info // ********************************************************************** include("inc/functions.php"); include("inc/config.php"); include("lang/lang.php"); $themeurl = grabanysetting("themeurl"); // ********************************************************************** // Define our top links by calling getlinks() // ********************************************************************** $links = getlinks(); // ********************************************************************** // Define our ads by calling getads() // ********************************************************************** $ads = getads("account"); // ********************************************************************** // Grab any dynamic article content from the content table // ********************************************************************** $article_title = $pagecontent[title]; $article_content = $pagecontent[content]; $article_content = nl2br($article_content); // ********************************************************************** // Grab any settings that we will need for the current page from the DB // ********************************************************************** $browsertitle = grabanysetting("browsertitle"); $sitename = grabanysetting("sitename"); $slogan = grabanysetting("slogan"); // ********************************************************************** // Check and see if the user is logged in to the site // ********************************************************************** $loginstatus = logincheck(); $isloggedin = $loginstatus[loginstatus]; $loggedinname = $loginstatus[username]; // ********************************************************************** // End Prepwork - Output the page to the user // ********************************************************************** if($isloggedin == 'yes') { $user = $_POST["user"]; $user = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $user); $user = secure($user); $gm = $_POST["gm"]; $gm = secure($gm); $query = "SELECT * FROM ".$prefix."users WHERE username = '$loggedinname'"; $result = @mysql_query($query); //Loop out code $i=0; while ($i < 1) { $cash=@mysql_result($result,$i,"money"); $i++; } $query = "SELECT * FROM ".$prefix."users WHERE username = '$user'"; $result = @mysql_query($query); //Loop out code $i=0; while ($i < 1) { $cash2=@mysql_result($result,$i,"money"); $i++; } $cashs = $cash - $gm; $cashs2 = $cash2 + $gm; if($gm <= $cash){ $query = "UPDATE ".$prefix."users SET money='".$cashs."' WHERE username='".$loggedinname."'"; mysql_query($query); $query = "UPDATE ".$prefix."users SET money='".$cashs2."' WHERE username='".$user."'"; mysql_query($query); $article_content = "[Not active yet!]"; } } // ********************************************************************** // Begin Template Definition // ********************************************************************** //Define our current theme $file = $themeurl; // Do the template changes and echo the ready template $template = file_get_contents($file); $template = replace(':ARTICLETITLE:',$article_title,$template); $template = replace(':ARTICLECONTENT:',$article_content,$template); $template = replace(':ARTICLEDATE:',$article_date,$template); $template = replace(':BROWSERTITLE:',$browsertitle,$template); $template = replace(':SITENAME:',$sitename,$template); //Define our links $template = replace(':LINKSBAR:',$links,$template); //Get the content for the side bar... $sidebar = getsidebar(); $template = replace(':SIDEFEED:',$sidebar,$template); //Get the ad content... $template = replace(':ADS:',$ads,$template); //Get the slogan info $template = replace(':SLOGAN:',$slogan,$template); echo $template; // ********************************************************************** // End Template Definition // ********************************************************************** ?> Thank you SO much Magnie, and you are getting a massive credit on the site for this!! :D :D |
#10
|
||||
|
||||
![]()
on a side note, this is the last chance to get the soon to be extinct Alacorn there on KK --- go to the Promo page on your sidebar, enter ALACORN, and you may take as many as you wish, before midnight tonight!!
We are dropping them after that, they are a one time very special creature! |
![]() |
Thread Tools | |
Display Modes | |
|
|
What's New? |
What's Hot? |
What's Popular? |