Always ends up being the simplest thing haha, I'm getting some results now. The script is still throwing up some wierd errors but through all my testing the codes become very messy so I assume I'll be able to sort all that out.
Thanks for all the help, I appreciate it.
User Profile
Collapse
-
You'll have to store the time in the database. Make this column datetime eg:
Code:ALTER TABLE somthing ADD date_added datetime NOT NULL DEFAULT "0000-00-00 00:00:00"
[PHP]
$date = date('Y-m-d H:i:s', time());
[/PHP]
This will give you time in the format yyyy-mm-dd hh-mm-ss. As for displaying it in formats...Leave a comment:
-
Thanks for that link, I was unaware you could turn Error Reporting on for just one page and with this new host I'm with (planning to switch to GoDaddy very soon) dosn't seem to allow me access to the php.ini file from the control panel. This helps a lot.
The error message I got was:
Notice: Undefined index: 1 in (address) on line 26
Line 26 being:
$title = $parent_array[1];
...Leave a comment:
-
Query Function Array
Been using PHP for a little while now but have never really looked into using functions and such thinking I didn't really need them (coupled with me be lazy). I've started a new project and have decided to get a handle on them and this tutorial:
http://bytes.com/forum/thread632487.html
Has helped me quite a lot, I've made some modifications and it for the most part everything seems to be working however this one problem... -
Fading / Rotating Images
I've been searching around quite a bit but I can't seem to find what I'm looking for. I'm after a tutorial or source code I could look at for rotating images with a fade effect. I'm looking to have somthing on my site that will rotate a few images (with the fade effect) and have for example the numbers 1, 2, 3, 4, 5 underneath, so clicking on that number would take you to the respective image. I managed to find a few tutorials for this sort of thing... -
I think your problem is here:
switch substr($cleanPo stCode,0, 2); {
The semi colon isn't needed I believe, so try:
switch substr($cleanPo stCode,0, 2) {...Leave a comment:
-
I use the following to check images:
[PHP]
if (!is_uploaded_f ile($_FILES['uploaded_image ']['tmp_name'])) {
$error = "You didn't select a file to upload.<br />";
} else {
if ($_FILES['uploaded_image ']['size'] > $maxfilesize) {
$error = "Your image file was too large.<br />";
unlink($_FILES['uploaded_image ']['tmp_name']);...Leave a comment:
-
Thanks for the responses.
People can upload image files on my site but they need to be signed up to do so and I didn't notice any odd usernames signed up, they all seem pretty genuine.
Thanks for that link too I'll definetely be having a thourough read of that. I do have password information stored in my one file which is for the database connection, which is in the public_html folder, is this what I should not be doing?...Leave a comment:
-
Hacker Site - SQL Injection
Quite a while back now I had a file uploaded to my site overwriting the index, which boasted of this hackers amazing skills in defacing my site. Never did figure out how they did it, however I found my website listed on this site:
<link removed> (Note thats the link to some sort of hacker site, the link may not be safe I don't know so just letting you know).
Anyway, the site is in another language but I noticed... -
Files not Downloading Properly
When I link to a file on my site eg: www.examples.co m/uploads/somthing.psd instead of a message coming up prompting users to Open / Save the file, it opens up in another explorer window with somthing like this:
6C4DC4D6*ë* È#4*â„ ÿÿÿÿÃVÃX ÃYÃS„ „ÿÿÿÿé êë ìütu vwxyzƒ„…†‡ˆ‰Š’“ ”•–—˜™š¢£¤¥¦§¨© ª²³´µ¶·¸¹ºÂÃÄÅÆ ÇÈÉÊÒÓÔÕÖרÙÚáâ ãäåæçèéêñòóôõö÷ øùúÿÄ ... -
For now I've just wrote a new registration script (the other one was beyond salvagable). So at least people visiting my site can register now but there is no CAPTCHA (which for now is not a problem). If anyone still has any ideas as to why that may have happened please post or if you can recommend another CAPTCHA script I could look into I'd appreciate that.
Thanks.Leave a comment:
-
Hi thanks for the response, here is a snippet of code that I think will be the most relevant (the entire thing is quite long):
[PHP]
function make_seed() {
// from http://php.net/srand
list($usec, $sec) = explode(' ', microtime());
return (float) $sec + ((float) $usec * 100000);
}
function rand_color() {
global $bg_type,$rand_ func;
if($bg_type==3)
{...Leave a comment:
-
Big CAPTCHA Problem
My host has been 'upgrading' lately and its caused me a whole mess of problems. The last of which being that my CAPTCHA form no longer works. I remember to get the CAPTCHA working it took me weeks to do (this was a long time ago too), and at some point I recall editing it in a Hex editor before finally getting it to work, basically I do not have a clue what this thing needs to do to work.
One day I tried my registration form (without... -
Thanks for that, very helpful info.
Just want to clarify, I'm under the impression that if I use a script that works on PHP 4 it should still work on PHP 5 for the most part. So am I able to continue to code how I always have or are there any common things that will no longer work or are deprecated.
Thanks again.Leave a comment:
-
PHP 4 or PHP 5
As I've mentioned before I'm creating a new and am trying to cover everything before I start, so I save myself a lot of work later.
One thing that has been concerning me for a while is the upgrade to PHP 5. I've tried searching around and can't seem to find much on how differently PHP 5 works regarding coding. I assume it isn't a very smart idea to just stick with PHP 4 so my question is what exactly has changed in PHP 5 and what do... -
Thanks for that pbmods, exactly the sort of thing I'm looking for. Very helpful....Leave a comment:
-
Thanks for the advice delite and the discussion of MD5 being cracked is fine, since it's pretty much what the threads about anyway.
I'm not looking for something that will check my current coding for vulnerabilities but some sort of a list of the most common practices to follow to ensure security with PHP and manipulation of data, or the most common mistakes people make that leave their code being vulnerable.
Thanks...Leave a comment:
-
PHP Security 101
I've had quite a bit of experience with PHP (I'm certainly no expert on the matter though) and lately I've been trying to find as much information on making my method of coding and manipulating database information as secure as possible.
I'm planning on creating a site now that will use PHP and MySQL, and the information people will be storing in the database may contain personal details and such. My last site just felt a little sloppy... -
Ah yes I see, so the /uploadedfiles folder I have to chmod so users can't access it, but by using the PHP script it will still allow them to download it?
Thanks for all the help I appreciate it.Leave a comment:
-
Thanks for the response but I'm not entirely sure what you mean, would you be able to elaborate on that at all?...Leave a comment:
No activity results to display
Show More
Leave a comment: