Jump to content

lice200

Members
  • Posts

    24
  • Joined

  • Last visited

    Never

Everything posted by lice200

  1. Hello, I am looking into skinning my FTP pages. ATM I do not like the way they look and want to improve them. I want to change the way this looks. (http://bastardfiles.com/Test/) Can anyone give me any info that might help me with this?
  2. Put the $vars in index.php instead of each file then just echo it in header and footer. Then include index.php; in footer and header.php.
  3. I didn't think about that. I will give it a try!
  4. I want to make a download page. However I do not want it to be linked anywhere on my site. Say I typed blahblahblahblah.com/instantdownload.html into my broswer, as soon as it loads that page i want it to start a download, can you help?
  5. Thanks for installing the mod, its very very handy and a nice addition to the website.
  6. what I want is two variable's in a single if statement. The only thing is I cannot make it work the way i have it. I do not want to have 7 if statements if possible. [code][code=php:0] <?php $day = Sat; if ($day = ('Sat', 'Sun')) { echo "It is the weekend!"; } ?> [/code][/code]
  7. Lawl thanks for posting after me :( you have me confused enough! heeh
  8. Do you see any problems with the changed code below? Such as errors, things that might cause a problem down the road? (I didnt change the fprint line yet, but i will) [code=php:0] <?php $times = array (     '0000' => 'Link Three',     '0600' => 'Link One',     '1400' => 'Link Two',     '1500' => 'Link Three', );   $curtime = date('Hi'); //Get the current time in format 24/h #for ($curtime = '0000'; $curtime < '2400'; $curtime += 100) {     foreach ($times as $t => $l) #{         if ($curtime >= $t) $link = $l; {     printf ("Current Time: %04d : %s<br>",$curtime,$link);    } ?> [/code]
  9. Barand, If you had to write the same script, how would you do it? Can you help me out more help, this doesn't seem the best way to write it. Thanks.
  10. [quote author=Barand link=topic=119506.msg489576#msg489576 date=1166708041] What link do you want displayed prior to 1200? [/quote] It should be Link Three because it is the last one. So; Current Time: 1500/0000 -through 1100 : Link Three
  11. Hello, I am trying to write code for a script that will take a set time, compare it to the current time, then echo a set link for that time slot. The thing is i have not been able to do this thus far with php. One of my problems is with if statements. When I use if statements the script becomes unstable and gives off results. At the moment I have some code written for the script. (See Code One) The problem is that when $curtime clicks over to 2000 (24/h format) the script stops working. Another problem is if $timestr is higher then $timstr2 the script again, stops working. So I am wondering, is there a better way to make this work. If you can give me a place to start that would be the first step in helping me make this work. Maybe you can write something out for me to help me compare and get me out of this block. Code One: [code=php:0] <?php //Specify the start time and the delay $timestr  = "1200"; $link1 = "Link One"; $timestr2 = "1400"; $link2 = "Link Two"; $timestr3 = "1500"; $link3 = "Link Three"; $curtime = date('Hi'); //Get the current time in format 24/h echo "Current Time: $curtime<br>"; if ($curtime >= $timestr) { // Script start. $link = $link1; } if ($curtime >= $timestr2) { $link = $link2; } if ($curtime >= $timestr3) { $link = $link3; } echo $link; ?> [/code]
  12. So I changed my code (Below) and now it is not echo'ing the $timestr2 even though it is past the set time. I changed the date function to Hi instead of hia. [code]<?php //Specify the start time and the delay $timestr  = "2333"; $link1 = "Link One"; $timestr2 = "2334"; $link2 = "Link Two"; $curtime = date('Hi'); //Get the current time in format 00:00:am/pm (Without ':') echo "Current Time: $curtime<br>"; if ($curtime > $timestr) { // Script start. echo "$link1"; } elseif ($curtime > $timestr2) { echo "$link2"; } ?>[/code]
  13. Hello, I am writing a script (duh) that will take a set time and the current time then within the code it will echo a set link (or whatever i want). However I am having trouble coming up with a way to do it. What I want it to do is when say it is 1030am I want it to echo a link (Set with $link). However if it is 1130am I want it to display different link instead of the other one. (Set with link2). My problem is when it is 1030am it echo's $link, then at 1130am it echo's $link2 at the same time as $link. Can you help me find a way to make it echo only one at a time? [code]<?php $curtime = date('hia'); //Get the current time in format 00:00:am/pm (Without ':') echo "Current Time: $curtime<br>"; //Specify the start time and the delay $timestr  = "0429pm"; $link1 = "Link One"; $timestr2 = "0431pm"; $link2 = "Link Two"; if ($curtime > $timestr) { // Script start. echo "$link1"; } if ($curtime > $timestr2) { echo "$link2"; } ?>[/code]
  14. When you add + 0 to the date in $curmonth it will show only the month. now i can take the current month which is 6, take the month of the link which is 3, find out the difference which is 3. Now that i know the link is three months old. I need to have it delete it. My problem is not with how I have the date setup, that is fine. My problem is i dont know how to make it auto-delete it. Like i said before, i have a delete script that is setup to run off $link_id. So if i tell it to delete link_id=17 it will delete the 17th link... So again my question is. What can I use to make it delete the link when it hits age?
  15. Hey, I wrote a script to check the date of a link, find how old it is, then if it is older then the said max date, delete it. But I cannot figure how to have it delete it... on its own... [code]<?php $query=("SELECT * FROM archive ORDER BY link_id DESC"); $result=mysql_query($query); $row = mysql_fetch_row($result); $link_id = $row[0]; mysql_close(); $curmonth = date('m-d-Y') + 0; //Find out the current month $monthchange = $link_date + 0; //Find out the month of the link $month = $curmonth - $monthchange; //Find the month offset if($month < 2){ //Do nothing if link is less then 2 months old         } if($month == 2){ //Do nothing if link is 2 months old         }if($month > 2){ //Start deletion process if link is older then 2 months //Here is where i tell it to auto-delete the link.. } ?>[/code] I don't know what to put to make it auto-delete it. I have a delete script set up to run of link_id. Can you help me please?
  16. [!--quoteo(post=382775:date=Jun 12 2006, 02:39 AM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ Jun 12 2006, 02:39 AM) [snapback]382775[/snapback][/div][div class=\'quotemain\'][!--quotec--] [code] $link_title = mysql_real_escape_string($_POST['link_title']); $link_link = mysql_real_escape_string($_POST['link_link']); $link_date = mysql_real_escape_string($_POST['link_date']); $link_sfw = mysql_real_escape_string($_POST['link_sfw']); $query = ("INSERT INTO archive (link_title,link_link,link_date,link_sfw) VALUES ('$link_title', '$link_link', '$link_date', '$link_sfw')"); mysql_query($query); mysql_close(); [/code] [/quote] Thanks ^^
  17. Okay this is my code now [code]    $link_title = $_POST['link_title'];     $link_link = $_POST['link_link'];     $link_date = $_POST['link_date'];     $link_sfw = $_POST['link_sfw'];         $query = ("INSERT INTO archive (link_title,link_link,link_date,link_sfw) VALUES ('$link_title', '$link_link', '$link_date', '$link_sfw')");         mysql_query($query);         mysql_close();[/code] This is what i tried... [code]    $link_title = $_POST['link_title'];     $strreplace = str_replace ("\'","'",$link_title);     $link_link = $_POST['link_link'];     $link_date = $_POST['link_date'];     $link_sfw = $_POST['link_sfw'];         $query = ("INSERT INTO archive (link_title,link_link,link_date,link_sfw) VALUES ('$strreplace', '$link_link', '$link_date', '$link_sfw')");         mysql_query($query);         mysql_close();[/code] Sorry for the touble. I just don't understand how it works...
  18. I'm here because im a noob, you can tell me what todo, but it doesnt help if i dont know how todo it. Please take the time to explain it to me.
  19. [!--quoteo(post=382182:date=Jun 10 2006, 03:36 AM:name=radalin)--][div class=\'quotetop\']QUOTE(radalin @ Jun 10 2006, 03:36 AM) [snapback]382182[/snapback][/div][div class=\'quotemain\'][!--quotec--] yes, there is function for that in php. $searchstring = str_replace ("\'","'",$searchstring) ; this function will replace all " ' " with a " \' " and by this way your query will not blow up. [/quote] Where do i put this?
  20. [!--quoteo(post=382172:date=Jun 10 2006, 03:04 AM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ Jun 10 2006, 03:04 AM) [snapback]382172[/snapback][/div][div class=\'quotemain\'][!--quotec--] try doing \' [/quote] Thanks for the help. That will not work. You have to understand that I have to enter alot of these per day. Many of them have a apostrophe. Adding a \ to every single one would be to time consuming... Is there any other way I can have done for me?
  21. Hi, When i try to enter a apostrophe into my Text Field then submit it to a database the text will not show up. Database Structure: Link_ID Int(11) Not Null Auto_increment Link_Text Text Not null Example: Without Apostrophe I like php Link_ID: 1 Link_Text: I like php ---------------------------------- Example: With Apostrophe I like php' Link_ID: 2 Link_Text: ---------------------------------- I don't understand why it's doing this. Can you help me find a solution? -Lice
  22. Hello, I am currently trying to find a way to limit the max characters shown not the max characters entered. example: Hello my name is lice, I am trying to write a script for my website that will allow me to set the max characters shown on the main page with a link to the full article. This would be shown on a main page Hello my name is lice... more <Link Can you please push me in the right direction to where I could find something that will show me how todo this. Thanks -kick
×
×
  • 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.