Hey guys,
So the reason i haven't been on that much lately is because I've been coding this new game I've been working on but for some reason i get errors on a lot of the pages for some reason. I'm running the code off of a WAMP server with:
Apache 2.2.17
PHP 5.3.3
MySQL 5.5.8
I"ve been programming php for a good amount of time, however I just started working with WAMP servers not that long ago so I don't know if some of my errors would have to do with the server itself or not. I've got most of the code done I was just hoping the community could go over my coding and tell me where the mistakes are and help me fix them.
Thanks, Ryan
P.S This is the link i've loaded all my files too http://www.mediafire.com/?c0dk2c5r805rj
I'm so confused...
I'm so confused...
Advanced:Html(XHTML), CSS, Writing
Intermediate: php, MYSQL, Level Design, C++, JavaScript
Beginner:Java, C-Lite, 3D modeling
The difference between me and you:
You:
Me: 

Intermediate: php, MYSQL, Level Design, C++, JavaScript
Beginner:Java, C-Lite, 3D modeling
The difference between me and you:
You:



Re: I'm so confused...
what kind of errors are you getting?
- rockinliam
- Posts: 466
- Joined: Sun Jun 07, 2009 11:26 am
Re: I'm so confused...
Upload it to a free web host give us the link and we shall alpha test it and such. This will help us determine easier where bugs are and where security flaws may exist.
Skillset: C/C++, OpenGL, C#, Lua, PHP, MySql, Web Dev etc.
Website: https://liam-griffiths.co.uk/
Website: https://liam-griffiths.co.uk/
Re: I'm so confused...
I'm getting errors like deprecated code and i also notice some files like for example,
And Liam the game isn't even available to alpha yet because my problem is, IT BARELY WORKS AT ALL!
How do i upload the files to a site like mediafire and group them together so you can do one mass download of all the files instead of one by one?
for some reason some includes aren't connecting.include_once ("config.php")
And Liam the game isn't even available to alpha yet because my problem is, IT BARELY WORKS AT ALL!

How do i upload the files to a site like mediafire and group them together so you can do one mass download of all the files instead of one by one?
Advanced:Html(XHTML), CSS, Writing
Intermediate: php, MYSQL, Level Design, C++, JavaScript
Beginner:Java, C-Lite, 3D modeling
The difference between me and you:
You:
Me: 

Intermediate: php, MYSQL, Level Design, C++, JavaScript
Beginner:Java, C-Lite, 3D modeling
The difference between me and you:
You:



- PaxBritannia
- Posts: 680
- Joined: Sun Apr 18, 2010 1:54 pm
Re: I'm so confused...
For the downloads, try compressing them into a self-extracting archive.
pax.
pax.
Re: I'm so confused...
Well, first check if you have used ; at the end of all lines. Some PHP functions like eregi() are deprecated, instead use functions like str_replace.
For the warnings, check the corresponding code and look it up at php.net. The PHP API is very good, so most awnsers can be found there alone.
For the warnings, check the corresponding code and look it up at php.net. The PHP API is very good, so most awnsers can be found there alone.
Re: I'm so confused...
Thanks Xaleph, I found the answer to one of my problems on there a little while ago but, now i'm having problems with something else i cant figure out.
my connect.php file works fine ive checked the connect it seems like 10 times already but, when i go to log in to test and try to work out the other bugs i get this:
and when i check the server through phpmyadmin i look in the users table and the column 'name' is in there, but it's still throwing that out at me and idk why.
Also, thanks for that pax idk why i didnt just ZIP them in the first place..
my connect.php file works fine ive checked the connect it seems like 10 times already but, when i go to log in to test and try to work out the other bugs i get this:
and this is the code it's referring to:Undefined index: name in C:\wamp\www\untitled\index.php on line 10
Code: Select all
if (preg_match('[^A-Za-z0-9]', $_POST['name'])) {// before we fetch anything from the database we want to see if the user name is in the correct format.
echo "Invalid Username.";
}else{
$query = "SELECT password,id,login_ip FROM users WHERE name='".mysql_real_escape_string($_POST['Username'])."'";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
Also, thanks for that pax idk why i didnt just ZIP them in the first place..
Advanced:Html(XHTML), CSS, Writing
Intermediate: php, MYSQL, Level Design, C++, JavaScript
Beginner:Java, C-Lite, 3D modeling
The difference between me and you:
You:
Me: 

Intermediate: php, MYSQL, Level Design, C++, JavaScript
Beginner:Java, C-Lite, 3D modeling
The difference between me and you:
You:



Re: I'm so confused...
You are matching the IF statement. This means that you did get a match there, which means it doesn`t go to the else, where you declare your $name.
Btw, the error is PHP, not Mysql. So the query should work fine i guess, but you just don`t have a name to give.
Anyway, i looked over your code again and i see this is your problem:
In the first you use $_POST['name'] and in your query you use $_POST['Username'].
Try sorting that stuff out too.
Btw, the error is PHP, not Mysql. So the query should work fine i guess, but you just don`t have a name to give.
Anyway, i looked over your code again and i see this is your problem:
In the first you use $_POST['name'] and in your query you use $_POST['Username'].
Try sorting that stuff out too.