Earn Resources
Moderator: General Moderators
Earn Resources
Does any1 know a code (or make a code) that it has as function to get a specific amount of resources (metal or gold or wood) and let it go on for 24 hours a day?
And that you could buy something with it. But that you also could upgrade buildings so that the amount of resources increases?...
I don't know if it is possible, but I searched everywhere and found nothing.
Pleas help,
gaMer13
And that you could buy something with it. But that you also could upgrade buildings so that the amount of resources increases?...
I don't know if it is possible, but I searched everywhere and found nothing.
Pleas help,
gaMer13
I use simpletest browser class for that.. http://timvw.madoka.be/programming/php/smscity.php.txt.
But most online games require you to solve a captcha (find the letters in an image) before they acccept your commands...
But most online games require you to solve a captcha (find the letters in an image) before they acccept your commands...
Yes for a game that I want to develop.phpdevuk wrote:are you talking about some kind of game?
Look at the screeny from a game. (On the top of the screen you see "Metaal | Kristal | Deuterium etc" these are the resources that increase every 24 hours.)
@timvw : What do you mean with: captcha
sounds like you are trying to build something along the lines of http://astronest.com, I've not heard fo any classes specifically for this sort of thing, but there may well be one out there, what places have you tried looking for them on?
1. HotScripts.com : For examples, but none are good enoughphpdevuk wrote:sounds like you are trying to build something along the lines of http://astronest.com, I've not heard fo any classes specifically for this sort of thing, but there may well be one out there, what places have you tried looking for them on?
2. php.resourceindex.com : For examples, but none are good enough
3. Planet-Source-Code.com : For tutorials + examples, but found nothing
4. PHP.net : For snippets + tutorials, but found nothing
5. PHPHulp.nl : For tutorials + snippets, but found nothing
Well, I think thats already enough
EDIT::
Btw thnx for the support. But I'm a little bit hopeless
I've studied PHP for 1 year but I think my title here on this forum "Beginner" is the correct term for me. I'm still studying PHP, but I don't know where to start because I don't have a basic think...phpdevuk wrote:I guess you could always code it yourself using one of the others as a basis? incrementing a number in a database is as easy as recording a date really.
EDIT::
But I'll try
Question:
How do I get the data from a form. I have this code
You see that it has a TABLE that has as fields inside: First, Last, Phone etc. How do I get that info from a page before?
It was something like $_Get[post] or something 
How do I get the data from a form. I have this code
Code: Select all
<?
$user="username";
$password="password";
$database="database";
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="CREATE TABLE contacts (id int(6) NOT NULL auto_increment,first varchar(15) NOT NULL,last varchar(15) NOT NULL,phone varchar(20) NOT NULL,mobile varchar(20) NOT NULL,fax varchar(20) NOT NULL,email varchar(30) NOT NULL,web varchar(30) NOT NULL,PRIMARY KEY (id),UNIQUE id (id),KEY id_2 (id))";
mysql_query($query);
mysql_close();
?>Code: Select all
Index page = form
Insert page = this page <---- how do I get the info from the form?hehe thats a fair way from inputting data from a form 
I tend to use the format like this, say we have a variable on our form called first, on my index page I would refer to it as $_REQUEST['first']
let me show you an example
the form
insert code
hopefully that makes some sense, thats just a brief example, I'd put all of the db username and passwords into a config file if I was you and just include it at the top of the page.
I tend to use the format like this, say we have a variable on our form called first, on my index page I would refer to it as $_REQUEST['first']
let me show you an example
the form
Code: Select all
<form action="insert.php" method="post">
<input type="text" name="first" value="">
<input type="submit" name="submit" value="go">
</form>Code: Select all
$sql = "INSERT INTO contacts SET first ='".$_REQUEST['first']."'";
mysql_query($sql);its a good habbit to use the correct way of calling a variable so that you don't mix variables up, e.g
if a variable has come from a post use $_POST['variable']
if a variable is in the URL use $_GET['variable']
the $_REQUEST['variable'] works for either so be careful if you already have a variable with the same name in the url etc.
this is all quite basic stuff tho, you can make things alot more complicated
if a variable has come from a post use $_POST['variable']
if a variable is in the URL use $_GET['variable']
the $_REQUEST['variable'] works for either so be careful if you already have a variable with the same name in the url etc.
this is all quite basic stuff tho, you can make things alot more complicated