Jump to content
MakeWebGames

Basic Jobs


WarMad

Recommended Posts

This is my first complete mod in a VERY long time i just started making games again if you want anything added or would like to add something feel free to do so

run this in phpmyadmin

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

you will also have to add job and jobpay int 11 into the users table

make a file called jobs.php and add this code

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

then add this in cron_day.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

please give me your feedback let me know what you think about it im just learning how to secure things so please give me some info on that as well thank you

Edited by WarMad
Link to comment
Share on other sites

Some things to note:

I would suggest reading up on PSR: http://www.php-fig.org/psr/psr-2/:

Use proper indentation, curly braces on the same line as your control statements i.e:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

PSR 2 helps improve readability

If your going to use *sprintf then use it

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

To:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

I would also remove all your connection variables from your $sql* variables and place them in your actual mysql_query() calls.

Other than that stuff, not too bad

Link to comment
Share on other sites

ok thanks for the feedback i updated the sprintf but for

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

i dont really understand i get confused seeing it and reading it on that site is there any chance you can be bothered enough to take part of my code and give me an example that way so i can understand a little better if your not up to it its ok thank you for the help you have already given

Link to comment
Share on other sites

and if your up for it can you show me an example of removing all my connection variables from my $sql* variables and place them in my actual mysql_query() calls with just 1 example sorry i keep bothering i really want to learn haha

Link to comment
Share on other sites

Your cron still has the connection variable in the sprintf(), your fomatting is still non-existent and also you don't need to sprintf() every query; unless you are actually formatting it, which some of them you don't need. It's just adding a tiny bit extra processing where it's not needed.

Me personally, I do not like to use that function to format my queries and I would rather use prepared statements for that but unfortunately for you, you don't have the luxury. I would more than likely use it for output on a string of something:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Link to comment
Share on other sites

Ugh.. Genuine stomach churns whilst writing this - friggin' mysql_*() bleh..

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

And cron becomes:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...