PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
hi guys,
I'm looking for some pretty basic help with my news post.
I just need someone that knows php to help me out with these php scripts
this is the script to input the information into the database newspost.php
It all wprks well but I need to be able to input a date that will be displayed as eg. Sun 26th Nov 2005 instead of the default date format.
And also I want the current date news or the next relevant date to be displayed and the old news to be removed from the post? I want to be able to enter a post for a day specified by the date I enter, no timestamping
this is the script to input the information into the database newspost.php, have a look and see if you can figure out any solutions to my problem?
probably because you arent coding to account fro register_gobals = off
your code will only work with register_globals = on, which is a pretty big security issue all by itself - so..
you need to get all the post values pulled out of the $_POST superglobal like so:
and if I were you, I would clean and sanitize (filter) the user inputs , to make sure that the $_POST values do not contain SQL injection hacks, etc ..
Both of these are not recommended as they both allow the user to inject variables into your script. Most of the time this will not be harmful, but it safer to check against variables that you were not expecting.
that's awesome advice, I'm really a bit naive in thinking that that sort of hacking won't happen to me, thanks for switching me on to it
How can I change my date ourput to eg. Mon 28th Nov 2005? and also how can I create some sort of admin section where I can access my database and change it's values? like date and content etc?
thanks heaps for your comments, the've been an awesome help and learning explosion
Mon 28th Nov 2005 = date('D jS M y')
All it takes is a look into manual...
you can create admin section by having a separate sub-domain/directory, introducing a secure login system and coding the admin panel... as simple as that
thanks heaps, I think got some timestamp thing going on cos I only get todays date in my post? can you tell me what variables and values I need to set my date to so I can just enter any date in? And how can I enter a date in as 28-11-2005?
any help would be awesome
sparklehorse7 wrote:can you tell me what variables and values I need to set my date to so I can just enter any date in? And how can I enter a date in as 28-11-2005?