Announcement

Collapse
No announcement yet.

Anyone know of a script to...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dan615
    replied
    This is how forums update the online user list...derrrr

    Leave a comment:


  • scoutt
    replied
    no prob

    Leave a comment:


  • megahard
    replied
    Originally posted by scoutt
    yeah you're right, I don't code in php at all.
    sorry for snappin, I guess we all had to start sumwhere.

    Leave a comment:


  • scoutt
    replied
    yeah you're right, I don't code in php at all.

    Leave a comment:


  • megahard
    replied
    Originally posted by scoutt
    ok I don't think you understand. where do you get your stuff to update?

    how do you update? do you do it through a database? do you paste text in the script? how do you do it?
    i take it u dont code much PHP and therefore ur of little help to this topic and quite irritating to be honest with you.

    if you dont understand then dont bother.

    you can store the text whereever the hell you want. If he is using mysql then fair enough, if he isnt then it doesnt matter.

    basically all you would have is have:

    in tempfile.php put:
    sometemptext

    PHP Code:
    $file file('./tempfile.php');
    $line $file[0];

    // if the date is correct and the file is in tact
    if( date("n j") == '8 30' && $line == 'sometemptext'){

    // do the update
    mysql_query("INSERT INTO newsorwotever (field) VALUES ('$text')");

    // wipe the file so that it doesnt get updated again
    $fo fopen('./tempfile.php''w');
    fclose$fo );


    untested, but the principle would work fine as long as tempfile.php was chmoded correctly.

    Leave a comment:


  • scoutt
    replied
    ok I don't think you understand. where do you get your stuff to update?

    how do you update? do you do it through a database? do you paste text in the script? how do you do it?

    Leave a comment:


  • f00kj00
    replied
    If no one loads the site no one is gona see that it isn't update... If they load the site, and the script triggers a news post with a predefined date and stuff, thats just as good.

    But if did use a cron job it do that without someone loading, but who would see it before its loaded?

    Leave a comment:


  • scoutt
    replied
    really, then how is that script suppose to run when nobody is around to run it? he is talking automatic stuff here, not when somebody loads the site.

    Leave a comment:


  • megahard
    replied
    Originally posted by scoutt
    yes but the php script can't do it alone. you will have to make a cron job and that tells the server to run a certain script. some ISP's don't allow cron jobs.
    I disagree, you cud have a script that cud say:

    if( the date is after whatever date){
    update the site;
    }

    Leave a comment:


  • scoutt
    replied
    yes but the php script can't do it alone. you will have to make a cron job and that tells the server to run a certain script. some ISP's don't allow cron jobs.

    Leave a comment:


  • WizyWyg
    started a topic Anyone know of a script to...

    Anyone know of a script to...

    Im in need of a script that can update a website based on date and time.

    Say I am going on vacation for a week, and the site I update regularly needs to be updated once during that week. I'm looking for a script that will take information from a "text" file and publish it when that date comes around. Is there something out there that can do this?

    Ie my vacation is between 8/27 - 9/6
    Update needed on 8/30

    Is there a way to take information from a text file and tell the page to publish it when 8/30 rolls around?
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X