Jump to content

hitk

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

hitk's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. anyone can help me here. I am really confuse.
  2. I am currently using the below code which is not working. <script type="text/javascript"> function GetIst() { var d = new Date() var gmtHours = -d.getTimezoneOffset()*60; document.write(+ gmtHours); } </script> <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("mysql2", $con); $reminder = "<script language=javascript>GetIst();</script>"; $currentdate = date("Y-m-d"); $res = mysql_query("SELECT * FROM schedule WHERE sch_date >= '$currentdate' ORDER BY timestmp ASC limit 20"); while ( $row = mysql_fetch_array($res) ) { echo '<br />'.date('H:i', strtotime("+$reminder seconds",strtotime($row["sch_time"]))); } ?> It gives all times as 00:00. It should be like 12:30 or 04:30 But when excecute below it does work. <?php $time_current = "<script language=javascript>GetIst();</script>"; echo "". $time_current; ?> Now, I cannot use the second code because I also need to offset time for client time zone. What I believe error could be at echo '<br />'.date('H:i', strtotime("+$reminder seconds",strtotime($row["sch_time"]))); Help would be appreciated.
  3. My Issue is similar to http://www.phpfreaks.com/forums/index.php?topic=139559 I want to list Upcoming 12 Months from today's month. Ex. We are in July Month so list should be, July 2010 August 2010 September 2010 ... . . . June 2011 I am using smarty, so plz, let me know.
  4. Some how, Problem resolved (not totally but still good enough). http://www.daniweb.com/forums/post1269994.html
  5. Is it not possible to detect timezone and display according. ?
  6. You didn't read the whole thread.
  7. I dont have registration. I only provide data from mysql. I think something do with - http://www.maxmind.com/app/free
  8. It should not be that easy. Checked the updated post and you will get what I mean. How I know, from where the visitor is.
  9. Ok. Seems to be problem similar to http://www.webmasterworld.com/php/3398104.htm But I have no idea how to fetch data from mysql and convert it. Moreover, something javascript was use. No idea whether it work in my custom script. Edit : I might be wrong, what I am telling. It should be like this - http://www.cricinfo.com/england-v-australia-2010/content/series/426337.html?template=fixtures What I see is like below. When you see the url, it will time according to your ip (or zone no idea)
  10. I need to know what should I do to show event time (stored in mysql) according viewer's local time. I have stored time in two format (one simple 12:30; and another in timestamp format). The timings are of future and stored as GMT. Now, I would like to show time of event according to the viewer's location. Suppose Visitor is from India than Time should be in IST (GMT + 05:30 Hours). How its possible ?
  11. Ok. I have ZERO PHP Knowledge, still good in editing php and all that stuff. Only know copy paste and have no knowledge what that means. Still would try to explain my problem. I use variable to fetch data from mysql. Ex. my url is http://www.example.com/venue.php?vcity=New York. Now, I want to replace New York with New-York. The real url I am trying to get is http://www.example.com/venue-new-york.php. For that I added code in htaccess RewriteRule ^venue-([^/]*)\.php$ /venue.php?vcity=$1 [L] I Know what I added in htaccess is mostly perfect. Now, I am using smarty so would be able to do lower case and replace space with dash. But that would not allow me to fetch data from mysql for some reason. In class file I have following code. function getallvenueschedule() { global $db,$smarty; $sql = " SELECT * FROM table WHERE vcity = '$this->vcity' AND sch_date >= '$this->sch_date' ORDER BY timestmp ASC"; $theList = $db->getAll($sql); return $theList; } In the php file below is code. $vcity = $_GET['vcity']; I hope I provided almost all details. Problem is that whatever data is in variable vcity (examp. if I have new-york in url then it will search new-york in mysql rather new york
×
×
  • 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.