Jump to content

rt-box

Members
  • Posts

    6
  • Joined

  • Last visited

    Never

About rt-box

  • Birthday 06/19/1984

Contact Methods

  • MSN
    msn@emptybox.ws
  • Website URL
    http://www.emptybox.ws

Profile Information

  • Gender
    Not Telling
  • Location
    Paris, France

rt-box's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [!--quoteo(post=372632:date=May 9 2006, 05:28 PM:name=paul.mearing)--][div class=\'quotetop\']QUOTE(paul.mearing @ May 9 2006, 05:28 PM) [snapback]372632[/snapback][/div][div class=\'quotemain\'][!--quotec--] When i try to use: [code]$open_date1 = strftime("Y-m-d I:Mr", strtotime($open_date));[/code] i get blanks results...when i try it with date(), i get the following error: Warning: date(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in c:\inetpub\wwwroot\magic8\SevBoard\PHPSevboard\sev123brd.php on line 86 [/quote] As I said in my first reply: [!--quoteo(post=372581:date=May 9 2006, 02:42 PM:name=rt-box)--][div class=\'quotetop\']QUOTE(rt-box @ May 9 2006, 02:42 PM) [snapback]372581[/snapback][/div][div class=\'quotemain\'][!--quotec--]In versions prior to PHP 5, you'd also have to get rid of the microseconds in the time you get from the database, as it will generate an error in strtotime().[/quote] So now you know: check the version of PHP you are using, and if prior to version 5, remove the microseconds from the $open_date string: [code]$open_date1 = strftime("Y-m-d I:Mr", strtotime(substr($open_date, 0, strrpos($open_date, "."))));[/code] If I may add - no offense - please read twice and check all the indications given before reposting. And also, do check the [a href=\"http://www.php.net/docs.net\" target=\"_blank\"]PHP reference[/a] before posting as it [i]does[/i] help [i]a lot[/i]. hth RT
  2. [!--quoteo(post=372595:date=May 9 2006, 04:01 PM:name=cmgmyr)--][div class=\'quotetop\']QUOTE(cmgmyr @ May 9 2006, 04:01 PM) [snapback]372595[/snapback][/div][div class=\'quotemain\'][!--quotec--] Another question... How do I make this dynamic to where they have a little text box and they type in the name they want, and after it is verified, then it goes and makes the redirect? [/quote] You only need to figure out a generic RewriteRule so that all URLs matching <http://www.example.com/anyname> (and only those URLs) will point to [a href=\"http://www.example.com/profile.php?username=anyname\" target=\"_blank\"]http://www.example.com/profile.php?username=anyname[/a]. As the documentation shows, you just have to figure out what's the regexp for that. Once you have done that, when a user registers, you just need to check whether they want an existing username, and register it normally. Since the redirect will work for any name, there's nothing else to do on that side. You also have to change your profile.php page so that if someone comes to [a href=\"http://www.example.com/unknown_username\" target=\"_blank\"]http://www.example.com/unknown_username[/a], the profile.php either throws a 404 page, or nicely tells the client that he probably misspelled the name.
  3. [!--quoteo(post=372568:date=May 9 2006, 03:11 PM:name=paul.mearing)--][div class=\'quotetop\']QUOTE(paul.mearing @ May 9 2006, 03:11 PM) [snapback]372568[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hi, I have outputs from a sql database which print out in this format: 2006-05-09 18:11:20.000 is there a simple way i can format it so it looks like this: 2006-05-09 6:20pm Any ideas? Thanks. [/quote] $output = strftime("Y-m-d I:Mr", strtotime($date_from_db)); In versions prior to PHP 5, you'd also have to get rid of the microseconds in the time you get from the database, as it will generate an error in strtotime(). For further precision, read the documentation. hth
  4. [!--quoteo(post=372570:date=May 9 2006, 03:15 PM:name=cmgmyr)--][div class=\'quotetop\']QUOTE(cmgmyr @ May 9 2006, 03:15 PM) [snapback]372570[/snapback][/div][div class=\'quotemain\'][!--quotec--] You know how myspace let's you pic your own url? (myspace.com/myname) How do I impliment that on my own site. I currently have the profiles set up as profile.php?userid=usernumber [/quote] You need to have mod_rewrite enabled in Apache and configure it so that when www.example.com/myname is called, it loads profile.php?username=myname. In that case your users must have unique usernames. You can refer to [a href=\"http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html\" target=\"_blank\"]the Apache website[/a] for mod_rewrite documentation. It's fairly straightforward.
  5. Hi all I'm currently designing a PHP app that should be subject to intense peaks of connections once it is in place. I'm therefore pondering whether to implement some kind of caching system. Full HTML output caching is out of question, as the app is divided into different parts that can evolve at different paces depending on the kind of activity they receive. The main constraint is that data from the different parts can be needed in to display other parts, or to display some user-defined page. So my choice is the following: (a) just don't cache, hope the servers will hold, and grab the data from the database when needed and compute the HTML output every time; OR (b) set up an intermediary data storage in XML for each module, and when loading a module inside a page, just check the data has not been modified (through a track number in the database) and insert it into a main XML document representing the page, to be transformed into HTML. The idea of using XML also seems interesting as it allows reusing cached data anywhere in the app. So the big deal is whether (b) is really better than (a) in terms of performance, knowing that the database queries we are talking about can be very different across modules - loops through forum posts or just grabbing one record from a table. There's a also subsidiary question to choice (b) : should the XML file we get in the end representing the page be transformed with XSLT server-side or client-side ? I mean, does anyone know whether many users could end up not seeing the page as they should because their browser doesn't know about transforming XML ? Thanks for any comments. RT
×
×
  • 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.