Rusty.Metal Posted February 12, 2003 Share Posted February 12, 2003 (edited) Well i thought i show you my backend php for my site... http://digital-omni.com/siteadmin/admin.php and i got the news to display http://digital-omni.com/news/news.php note : if it dosent work im fixing bugs or what-not.., and sooner or later when i do my site, it WILL be password protected once i intagrated into my site.... my first backend php type thing Comments ? Edited February 12, 2003 by aaronsam Link to comment Share on other sites More sharing options...
0 Tim Dorr Veteran Posted February 12, 2003 Veteran Share Posted February 12, 2003 rough, but it works. glad to see your interest in actually doing this on your own. too many people expect someone else to code the php for them and bitch if it doesn't do what they want :D Link to comment Share on other sites More sharing options...
0 Rusty.Metal Posted February 12, 2003 Author Share Posted February 12, 2003 ya..i know what you mean.. but anyway i know your backend it much better :( :blink: :wacko: p.s. the reason some of the pages are different because i make 3/4 and think of a better way to do it.. so i like edit it and not start over... Link to comment Share on other sites More sharing options...
0 Ricky Baby Posted February 12, 2003 Share Posted February 12, 2003 use the date() function to add the date/time automaticly but other than that it shows promise Link to comment Share on other sites More sharing options...
0 Keldyn Posted February 12, 2003 Share Posted February 12, 2003 Dude. I don't want to see your backend! :o :rofl: Link to comment Share on other sites More sharing options...
0 Rusty.Metal Posted February 12, 2003 Author Share Posted February 12, 2003 --Smifffy i used the Date in the sql, and in the input i have it as curdate() but it comes out 02:22:03 weird stuff.. along witht he time..., is there a way to fix this? i --Keldyn :crazy: :laugh: Link to comment Share on other sites More sharing options...
0 john smith 1924 Veteran Posted February 12, 2003 Veteran Share Posted February 12, 2003 <? $time=date("M d Y"); echo($time); ?> try that :) Link to comment Share on other sites More sharing options...
0 Rusty.Metal Posted February 12, 2003 Author Share Posted February 12, 2003 ya but it needs to be posted in the sql or it will give the current date, not when it was posted Link to comment Share on other sites More sharing options...
0 linked Posted February 12, 2003 Share Posted February 12, 2003 ... ok, so have the Submit News page use $time = date()... then load $time into your MySQL database... ;) Link to comment Share on other sites More sharing options...
0 Rusty.Metal Posted February 12, 2003 Author Share Posted February 12, 2003 k i got it i havent updated it yet $time=date("M d Y"); ^^^ need to be $date=date("M d Y"); duh Link to comment Share on other sites More sharing options...
0 Ash Posted February 12, 2003 Share Posted February 12, 2003 Instead of just curdate do CURDATE() and CURTIME() that way you can print the date and time seperatly The sql query statement I used for a site went like this : $query = ("INSERT INTO `****` (`******` , `********` , `theDate` , `theTime`, `*********`) VALUES ('', '*********', CURDATE( ), CURTIME( ), '*********')"); I put **** in place of the fields i used for showing here, just for security reasons. Then I created a function that formats the time into a more readable format in am and pm function format_time($postTime){ $timeArray = explode(":", $postTime); $numItems = count($timeArray); $timeHour = $timeArray[0]; $timeMin = $timeArray[1]; if($timeHour < 12){ $timeAMPM = "AM"; switch($timeHour){ case 01: $timeHour = 1; break; case 02: $timeHour = 2; break; case 03: $timeHour = 3; break; case 04: $timeHour = 4; break; case 05: $timeHour = 5; break; case 06: $timeHour = 6; break; case 07: $timeHour = 7; break; case 08: $timeHour = 8; break; case 09: $timeHour = 9; break; } } else{ $timeAMPM = "PM"; switch($timeHour){ case 13: $timeHour = 1; break; case 14: $timeHour = 2; break; case 15: $timeHour = 3; break; case 16: $timeHour = 4; break; case 17: $timeHour = 5; break; case 18: $timeHour = 6; break; case 19: $timeHour = 7; break; case 20: $timeHour = 8; break; case 21: $timeHour = 9; break; case 22: $timeHour = 10; break; case 23: $timeHour = 11; break; } } $timeString = $timeHour.":".$timeMin." ".$timeAMPM; return $timeString; } not enough room, continued on next reply Link to comment Share on other sites More sharing options...
0 Ash Posted February 12, 2003 Share Posted February 12, 2003 continued reply... Then in the loop that displays each news item, to call the function I did $postTime = format_time($rowNews[3]); ? // $rowNews[3] being the varible I used so in the end to print the date then time it was like print $rowNews[2].", ".$postTime If you goto www.maelstrommusic.com and the main page shows news, you can see what I mean. My solution may not be the most elegant, but it works, if you wanna dont get it working the other way and wanna use it. Edit : Ain't this stuff fun!!! The above mentioed site I did a lot in backend php, the whole site is updateable and can add content to and everythign without even really knowing any html at all, and the owner of the site never need to open a web file! Fairly time consuming tho! Link to comment Share on other sites More sharing options...
0 Rusty.Metal Posted February 12, 2003 Author Share Posted February 12, 2003 i did this <?php $date = date("F jS Y"); $time = date("g:ia"); //Adds News to Sql if ($Post == "Post!") { $sql = "INSERT INTO News SET UserName='$usernameform', UserMail='$usermailform', MessageSubject='$subjectform', MessageDate='$date', MessageTime='$time', MessageText='$messageform'"; if (@mysql_query ($sql)) { echo("<P>News has been added.</P>"); } else { echo("<P>Error adding submitted news:".mysql_error () ."</P>");}} Link to comment Share on other sites More sharing options...
0 Rusty.Metal Posted February 12, 2003 Author Share Posted February 12, 2003 hey u have any idea how i can make catigory type things... like downloads, add catigoreys, under that add downloads to that Link to comment Share on other sites More sharing options...
0 john smith 1924 Veteran Posted February 12, 2003 Veteran Share Posted February 12, 2003 http://www.hotscripts.com http://www.google.com YOU ARE LAZY AND WILL NOT LEARN ANY OTHER WAY THAN DOING IT FOR YOUR SELF!!!!!!!!! you know what i mean when i say that- and i am only joking- but seriously- alot of research is not very hard- and will reveal alot. Hotscipts has everything under the sun... and google has the universe. Link to comment Share on other sites More sharing options...
0 Rusty.Metal Posted February 12, 2003 Author Share Posted February 12, 2003 you know what i mean when i say that- and i am only joking- but seriously- alot of research is not very hard- and will reveal alot. Hotscipts has everything under the sun... and google has the universe. :D :D :D :D :woot: anyway i dident want some one to do it for me.. (well i do but) i cant think of a way in php to do it... Link to comment Share on other sites More sharing options...
Question
Rusty.Metal
Well i thought i show you my backend php for my site...
http://digital-omni.com/siteadmin/admin.php
and i got the news to display
http://digital-omni.com/news/news.php
note : if it dosent work im fixing bugs or what-not.., and sooner or later when i do my site, it WILL be password protected once i intagrated into my site....
my first backend php type thing
Comments ?
Edited by aaronsamLink to comment
Share on other sites
15 answers to this question
Recommended Posts