Pixel to Credit Exchange (Needs Codes)
Ive Seen some Hotel try to make a Pixels to Credits Exchange form and Fail :P So i decided i would give it a Try and so far about 85% done! But i find 2 things that are Errors and since ima Noobie and PHP still i need 2 simple Codes listed below maybe one of you can Code :)
This Idea greatly interest's users and Makes them stay on Longer to gain more Pixels.
1) The Get USER_ID Code
2) A Code that makes the user not able to Exchange if they have less than 10,000 or whatever Pixel Cost you decide.
Here is a Screenshot.
http://i1097.photobucket.com/albums/...xel_credit.png
Since i have to Do my Homework at the Moment cause its already late i dont have the Time to put a Download pack but when Codes are found to make it Fully work then i will put in codes and put download link.
:sleep:
The Needed USER_ID Code tells PHP Code which User Table to Update Pixel and Credit Amount.
The Dont allow USER_ID Code under 10,000 Pixels will stop users from having Abnormally Large amount of Credits and Abnormally Amount of negative pixels (-980,000 Pixels)
Re: Pixel to Credit Exchange (Needs Codes)
... Easy?, that's done with a few minites.
From mobile
Re: Pixel to Credit Exchange (Needs Codes)
Quote:
Originally Posted by
joopie
... Easy?, that's done with a few minites.
From mobile
There are people who can't get that done in a few minutes?
Nice dev mate :thumbup:
Re: Pixel to Credit Exchange (Needs Codes)
Quote:
Originally Posted by
joopie
... Easy?, that's done with a few minites.
From mobile
Like i said i still am a Noob PHP Coder. Second why havent i seen hotels with the Code to do so? if its So Easy why dont u help me and Everyone else with this Development
Re: Pixel to Credit Exchange (Needs Codes)
Quote:
Originally Posted by
DaEternity
Like i said i still am a Noob PHP Coder. Second why havent i seen hotels with the Code to do so? if its So Easy why dont u help me and Everyone else with this Development
Cause anyone can make PHP Pages and throw a itsy bitsy design on it with no actual coding.
Re: Pixel to Credit Exchange (Needs Codes)
Here it is.
Don't blame with my code or it doesn't work.
Because this is not tested.
Errors? fix it self, this is only a base of whatever.
PHP Code:
if (isset($_POST['submit']))
{
$error = 0;
if (!empty($_POST['pixels']))
{
$pixels = $_POST['pixels'];
}
else
{
$error = 1;
}
if (!$error)
{
$oldpixels = mysql_result(dbquery("SELECT `pixels` FROM `users` WHERE `id` = '".USER_ID."' LIMIT 1"), 0);
if ($oldpixels <= $pixels) //Idk if this right, because i always mix the > and < ...
{
$newcredits = $pixels / 10;
$users->givecredits(USER_ID, $newcredits);
$newpixels = $oldpixels - $pixels;
dbquery("UPDATE `users` SET `pixels` = '".$newpixels."' WHERE `id` = '".USER_ID."' LIMIT 1");
}
else
{
$error = 1;
}
}
if ($error)
{
//go to error page, or what you want
header("location: http://".WWW."/your page error.php");
exit;
}
//go to succes page, or what you want
header("location: http://".WWW."/your page succes.php");
exit;
}
Re: Pixel to Credit Exchange (Needs Codes)
I think its great, people who is here to flame threads please leave? :)
Re: Pixel to Credit Exchange (Needs Codes)
Quote:
Originally Posted by
joopie
Here it is.
Don't blame with my code or it doesn't work.
Because this is not tested.
Errors? fix it self, this is only a base of whatever.
PHP Code:
if (isset($_POST['submit']))
{
$error = 0;
if (!empty($_POST['pixels']))
{
$pixels = $_POST['pixels'];
}
else
{
$error = 1;
}
if (!$error)
{
$oldpixels = mysql_result(dbquery("SELECT `pixels` FROM `users` WHERE `id` = '".USER_ID."' LIMIT 1"), 0);
if ($oldpixels <= $pixels) //Idk if this right, because i always mix the > and < ...
{
$newcredits = $pixels / 10;
$users->givecredits(USER_ID, $newcredits);
$newpixels = $oldpixels - $pixels;
dbquery("UPDATE `users` SET `pixels` = '".$newpixels."' WHERE `id` = '".USER_ID."' LIMIT 1");
}
else
{
$error = 1;
}
}
if ($error)
{
//go to error page, or what you want
header("location: http://".WWW."/your page error.php");
exit;
}
//go to succes page, or what you want
header("location: http://".WWW."/your page succes.php");
exit;
}
Thanks! I will try this!
Re: Pixel to Credit Exchange (Needs Codes)