
Shadowing
Members-
Posts
722 -
Joined
-
Last visited
Everything posted by Shadowing
-
Simple strtotime() converstion with offset
Shadowing replied to Shadowing's topic in PHP Coding Help
This isnt working for me for some reason its almost 7 hours off and the minutes are like 5 minutes off date_default_timezone_set('UTC'); $new = date('m/d/Y/H:i:s', time()-0600); echo $new; and if I only do this "with out the UTC set" its not even giving me my own time. 10 hours off $new = date('m/d/Y/H:i:s', time()); echo $new; -
I'm completly stuck on this
-
Simple strtotime() converstion with offset
Shadowing replied to Shadowing's topic in PHP Coding Help
thanks kicken big help is this how I do hour minute and second too? date('m/d/Y/H:i:s', time()-1200); also can I turn this as a variable like this $timezone = date('m/d/Y/H:i:s', time()-1200); and then echo it echo "This is your time $timezone"; am I doing this right? -
Simple strtotime() converstion with offset
Shadowing replied to Shadowing's topic in PHP Coding Help
ok want to make sure I understand this right since my server is -6 i cant use my user inputed offset cause it would be going against my -6 so i have to set it to UTC which is 0. so when someone has -12 it will be really -12 when comparing it to time(). when I do date_default_timezone_set('UTC'); does that change the server time to UTC always? or is that only for that script that is currently running I read someone in the forum where someone couldnt use the date_default_timezone_set('UTC'); cause it was dissallowed on the server. right now im using local host but will upload to a live host one day and id hate to be using something that wont work on a live server -
Trying to convert my UNIX time into a users offset time. Gathering the users offset in this format -1200 so I was reading about the date function in the PHP manual. but all the examples are using location words as offsets string date ( string $format [, int $timestamp = time() ] ) cant I just do $time = strtotime('-1200') I know i saw the conversion for this somewhere in this forum few days back but cant find it now. Im only wanting to convert the time when displaying it to the user only.
-
whats a more simple way to do it?
-
thanks guys was wondering about that for a while and thanks for the examples jcbones
-
whats the differance between mysql_query("UPDATE banned SET time and doing $safe4 = "UPDATE banned SET time mysql_query($safe4); is there a reason as to why do it the 2nd way i mentioned? if someone could please explain it to me so i wont be in confusion on this anymore
-
Alright got my array all done im acctually trying to insert the -1200 part into the data base <?php mysql_query("UPDATE users SET time_offset= '".mysql_real_escape_string($_POST['reason'])."' WHERE id = '".mysql_real_escape_string($_SESSION['user_id'])."'"); ?> how would I go about doing that
-
Thank you so much for explaining this to me in detail Ivkovic. this is going to teach me alot how to do a array I just started on it will let you know my progress. going to take me some time to make the array i have 101 of these to do lol.
-
Making a bat file for Window task Scheduler
Shadowing replied to Shadowing's topic in PHP Coding Help
making a web broswer game. every one minute was just to test it. making it so every hour it updates all accounts adding resources for players really appreciate you helping me out these last few weeks scootstah. im learning alot. i just have a hard time understanding the manuals on things -
Making a bat file for Window task Scheduler
Shadowing replied to Shadowing's topic in PHP Coding Help
ahh figured out how to make a bat file, then use what you told me to put in the bat file and then have window scheduler run it every minute pretty awesome -
Making a bat file for Window task Scheduler
Shadowing replied to Shadowing's topic in PHP Coding Help
opps forgot to go php/php.exe ok that loaded my script. whats my next step. how do i make this load my script every hour -
Making a bat file for Window task Scheduler
Shadowing replied to Shadowing's topic in PHP Coding Help
when command prompt first loads I get D:\documents and settings\shadowings> so I hit c: enter brings me down to c:\> then I type software\XAMPP\xampp\php.exe -f "C:\Software\XAMPP\xampp\htdocs\stargate\users\update.php" and gives the same error -
Making a bat file for Window task Scheduler
Shadowing replied to Shadowing's topic in PHP Coding Help
ahh alright i typed this into command prompt and got c:\software\xampp\xampp\php is not a recognized as an internal or external command. operable program or batch file. C:\software\XAMPP\xampp\php -f "C:\Software\XAMPP\xampp\htdocs\stargate\users\update.php" Thats my exact dir where my php folder is located though Im using xampp with PHP 5.3.8 -
Making a bat file for Window task Scheduler
Shadowing replied to Shadowing's topic in PHP Coding Help
i dont understand why all the instructions online stop at this point am i suppose to use window scheduler to open up php.exe while i have this command line wrote in it? -
Making a bat file for Window task Scheduler
Shadowing replied to Shadowing's topic in PHP Coding Help
Hey scootstah Yah i dont really need it to run in the browser ok I opened php.exe and typed in C:\software\XAMPP\xampp\php -f "C:\Software\XAMPP\xampp\htdocs\stargate\users\update.php" then I hit enter and it just took me to the next line -
Can someone help me out with making a bat file. I cant find a good set of directions on google. I have window scheduler all working in running but it runs my script in note pad and not IE like I need it too. I also read something about php cgi file for doing this same thing but cant make heads of tails out of it from reading about it in the manual. Trying to run this http://localhost/gate/users/update.php
-
Been reading like crazy today. I didnt know php only uses UNIX time Since im going to be using a ton of time comparisions i think i should just store UNIX time in a INT column and just use php time on everything until i have to display the time. still have no clue how the add date works in my favor
-
Yah im good now, thanks alot it wasnt the field missing i meant to say the entire row was missing. I really appreciate the responces from everyone
-
ahh I figured out whats wrong the field simply didnt exist.
-
well I ruled out timestamp being the issue I just tried grabing a name and echoing and it didnt work. user matches session id too check that also
-
still blank page. hmm i almost about had it with sql timestamps <?php $ban3 = "SELECT date FROM banned WHERE id = '".mysql_real_escape_string($_SESSION['user_id'])."'"; $ban2 = mysql_query($ban3) or die(mysql_error()); while ($ban1 = mysql_fetch_array($ban2)) { $pop = $ban1['date']; echo "$pop"; } ?>
-
thanks for the responce melloorr i tried that before posting doesnt work either
-
why cant I get this to echo? something so simple i dont understand what im doing wrong. can i simply not beable to display a sql timestamp with out converting 2011-12-19 14:57:45 <?php $ban3 = "SELECT date FROM banned WHERE id = '".mysql_real_escape_string($_SESSION['user_id'])."'"; $ban2 = mysql_query($ban3) or die(mysql_error()); $ban1 = mysql_fetch_array($ban2); $pop = $ban1['date']; echo $pop; ?>