Jump to content

Rollins

Members
  • Posts

    36
  • Joined

  • Last visited

Everything posted by Rollins

  1. I Registered on http://www.mywebcron.com/home.php ....made a page that inserts a date and time in a DB when hit. tested it...works. setup the cron...tested it through their "execute" link, "check" wich gets the html wich worked...... and let it go for a day. Out of the 1200+ crons registered on their site i was hit....2 times. after 2 days still no reply from support... i think i will check some other sites...
  2. oke...thanks for those replies! ignore_user_abort is more used for keep running scripts already started...by what or who ever? i just found this site...did you ever hear from it? or anything like that? http://www.mywebcron.com/home.php
  3. hmm i would rather not leave my laptop on the entire day..and i travel sometime so... could it be triggered from a other website? and the code...could it run...with ignore_user_abort(true);set_time_limit(0); it should right?
  4. Hey all! i was wondering if you could help me with the following... I want to pull some data/file from a foreign server at a specific time, every day. data would be inserted in a DB for users to search data they require. i did some research and came on cronjobs....not supported by my provider unless i get a upgrade and that would more then tripple my costs. don't wanna do that.... then i figured that i could create a page that would run through even when the browser was closed....so i wrote this but it is unstable and fails on me more than halve of the time. the next step for the script would be checking conditions(read time) where right it would execute code to retrieve the files. session_start(); //ignore user abort ignore_user_abort(true);//error report ini_set('display_errors', 1); error_reporting(E_ALL);/get time $date = date_create();//echo time echo $date->format('Y-m-d H:i:s');//check//+1 every refresh //get count $counter = $_SESSION['counter']; //add 1 if($counter > 0 ){ $counter = $counter; } else{ $counter = 0; } $counter++; $_SESSION['counter'] = $counter; echo '<br><br>'.$counter.'<br><br>'; //refresh every 60 sececho '<meta http-equiv="refresh" content="60; url=http://www.some.link.com/GetDataFromURL.php">';?> there is one fault (afik) in this code and that is the time limit...not able to set it unless i turn of "save mode" in the provider settings wich limits the php-enigine to run harmfull scripts...(roughly translated). i have read about the socalled "poor mans cron"...run it on users pages but that would limit the users and i don't want that either...and there is no guarantee that there will be a user every day. is there hope for the script that i wrote? if so, how can i improve it? Is there a alternative/scripting for cronjobs? can the DB(mysql) trigger events? any thoughts and comments are welcome! Roll.
  5. Rollins

    foreach loop error

    assign a value to a key? foreach ($passerrors as $error=>$message) { echo '.$error.' is '.$message.' ; }
  6. how did you resolve this? i went for a second query to get the id after the insert because it was the easiest solution for me at that time...
  7. you can store the inserted data in a session....echo that in meme.php or use data as a reference for the query on you.php. you can do a second query on you.php to request the id with the inserted as reference in the where clause....store that in a session. guess if you use 'SELECT LAST(id) you could get back the wron id... there are other functions in sql but i never used any....check the answers from stackoverflow.com. looks quit complete....
  8. some googlin....presto! this looks like the same issue. http://www.qianqin.de/qtranslate/forum/viewtopic.php?p=5988#p6142
  9. filter_validate_url should catch a http://random.com type url from what i have found.... the example you posted has a double dot...if u use that to test it could screw up the results aswell. i think.... "That said www.xxxx..com will not PASS the filter."
  10. and i was wondering what you use for error reporting....
  11. it looks like you are comparing a extension against a entire array.... elseif(($vtype == $vall)){ echo 'this format is not allow';} maybe someting like this....?? elseif(($vtype != "mov") && ($vtype != "wmv") && ($vtype != "mp4") && ($vtype != "mpeg") && ($vtype != "flv") && ($vtype != "avi")){ echo 'format is not allowed'; }
  12. i would try replacing the "www." with "http://www.".... function add_http($text){// set http: on www. $text = preg_replace( '"www\."', "http://www.", $text );// remove duplicates after set $text = preg_replace( '"http://http://www\."', "http://www.", $text ); $text = preg_replace( '"https://http://www\."', "https://www.", $text );}
  13. what would this do? single quotes... if(result_lv.n == 'ben'){ trace('hit');
  14. i am not very familiar with your coding but....Q: Does n have value in the if-statement? this looks lika a echo and does not seem to give value to n... echo"&n=".$username;
  15. thanks for that example! that also means there is a distinct difference between a variable and the content of a variable....i always looked at them as just one thing. i think i will look at the sort functions at a later point....
  16. the question got answered before it was asked....nice. and the original question was about the behaviour of the function. not specificly about the isset() or is_null(). although it is good to know.... thanks for the replies! all of you...
  17. dunno if it is proper testing but.... function ifisset($message){if(isset($message)){ echo $message; } else { $message = 'no data received'; echo $message; } } and function ifisset($message){if(IS_NULL($message)){ $message = 'no data received'; echo $message; } else { echo $message; } } both put out 'no message received' when i remove the original variable. they also put out a notice of a undefined variable....when i set the variable to $var ='NULL' they also echo 'no message received' both without the notice...the way i look at it both comparisons function the same or i must have missed something in my noobishness.... not sure what to conclude from the notices though....
  18. so the server reads the "whole line" and the function within that line. due to incorrect use of quotation marks the function gets put out first...because of the returned NULL? my next question is why does the/a/this function put out a NULL value? default behaviour? thanks for the example code! i got to that to...easier to read. Thanks for replying!
  19. i was trying to create a function....first time so i thought i do a simple " if isset echo" thing. <?ini_set('display_errors', 1);error_reporting(E_ALL); $var_jimmyjoy = 'jimmyjoy'; //functionfunction ifisset($message){if(isset($message)){ echo $message; }} echo "line 1 is echo : ".$var_jimmyjoy."\n"; // echo var (control)echo "<br>\n";echo "line 2 is echo function : ";ifisset($var_jimmyjoy);"\n"; //echo var through function?> that actually worked....but on the first attempt i wrote something that was rather lazy coding i think.... $var_jimmyjoy = 'explain this....jimmyjoy'; echo "line 1 is echo : ".$var_jimmyjoy."\n"; // echo var (control)echo "<br>\n";echo "line 2 is echo function : ".ifisset($var_jimmyjoy)."\n"; //echo var through function the output confused me...and still does as the order of the text gets shuffled....the variable gets put before the regular text. line 1 is echo : explain this....jimmyjoy<br>explain this....jimmyjoyline 2 is echo function : i could understand it would give a syntax error because of bad coding. the way i look at the order of how things should get processed and displayed it should not do that. been keeping be busy for a day now and couldn't find anything on this on searches...Can you help me explain this....
  20. Rollins

    REQUEST_URI

    That clarifies it.....Thank you JSG!
  21. Rollins

    REQUEST_URI

    oke...not to hijack this post but.... a URL leads to "just" a location....? a URI leads to a specific location or resource, and can contain some info in the form of location.php?info=random? (and then there is URN wich is name only...?)
  22. Rollins

    REQUEST_URI

    the link you posted seems incomplete..... but try requesting 'PATH_INFO' or 'ORIG_PATH_INFO' . see if that puts out anything....
  23. I think birbal means to say.... check kicked status on every page. edit the database with a kicked status and do a sql query and set session accordingly if ($_SESSION['kicked'] == 'true'){echo 'acces denied'; //or somethingDIE;} Sessions do not store data permanent..... DB check is a good way to go. but that was not what you wanted.... Maybe there is a way to search the file where session data is stored and alter that....if that is what you mean. >>http://us.php.net/manual/en/session.configuration.php#ini.session.save-path
  24. Rollins

    Help Me Gyz

    the * in "SELECT * FROM Products" actually means SELECT ALL FROM Products.... add a where clause after the DB..... "SELECT * FROM products WHERE productname LIKE "statement" ORDER BY price/best sold/or what ever" http://www.w3schools...l/sql_where.asp GL.
  25. shouldn the variables in the query be in single quotes.....? $query = "SELECT * FROM users WHERE username = $uname AND passhash = $passhash AND enabled = 'yes' AND status = 'confirmed'"; im just a n00b but shooting any way.....:s
×
×
  • Create New...