Jump to content

eddorey2k3

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

eddorey2k3's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey, Ok. So i've coded myself a nice little script to update the news section of my website. Works like a charm. However, the text area that you input the actual content of the news isn't all that smart (As you'd expect, it's just a text area), so all formatting has to be entered manually (Paragraphs, breaks, etc etc). What I'm trying to do, is now that the news panel is finished, is find a way of making it so any breaks in the content get auto formatted into the MySQL string that will get input into the database. I hope that makes sense, but as an example, if I were to do: [code] Todays news is That I like cheese. [/code] At the moment, it would come out as "Todays news is That I like cheese." For this reason, I'd need to put the suitable <br>'s in. What I want, is something to recognise it's on 2 lines, and auto insert the <br>'s and <p>. Any ideas?
  2. Ok. I have a script that pulls out the time it was run, and puts it into a database. That looks like this. [code] $date = date("DdSF,Y"); $time = date("g:i:sa"); [/code] I have no problem with this, it works fine. However, I do have a problem with the time it pulls out. Whilst it works fine, since it's in UTC and I'm in GMT it is always 5 hours behind. I'm looking for a way to solve this. I've been told that I need to add 18000 seconds to the time (Since that's 5 hours). As far as I can see, this will work, except for DST. Any ideas how I can either get it to add 18000 all the time, or work out the time for DST as well? Thanks.
  3. Hello! I'm sure this is a super simple fix, but for some reason I'm not seeing it. Any help would be good. The PHP is designed to capture certain information about the site visitor, and then store them in a database. Simple, really. The information is being captured, but for some reason, it's inputting the variable names into the database, instead of the values. It connects to the database correctly, and picks up the right table. The problem is that it submits the variable names, instead of the value.....even though I've already said that. The original code was obtained from the PHP website (I believe), but that used static values instead of dynamic variables. I'm assuming it's something to do with the variable names being in brackets? Code below. (The relevant section) [code]$date = date("D dS F, Y"); $time = date("g:i:sa"); //find out how to get this back into GMT $ip = $_SERVER['REMOTE_ADDR']; $referer = $_SERVER['HTTP_REFERER']; $useragent = $_SERVER['HTTP_USER_AGENT']; /*Adds the data to the database*/ $db = "databasename"; $result = mysql_select_db($db) or die("Unable to select the database, but could connect to server"); $adduserinfo = 'INSERT INTO `userlogging` (`ID`, `date`, `time`, `IP`, `browser`, `referer`) VALUES (\'\', \'$date\', \'$time\', \'$ip\', \'$useragent\', \'$referer\')'; $adduserinforesult = mysql_query($adduserinfo) or die ("Error in query $adduserinfo");[/code]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.