Jump to content

mr_zhang

Members
  • Posts

    46
  • Joined

  • Last visited

    Never

Everything posted by mr_zhang

  1. Hi cooldude832, Thanks for replying. Well, it's somehow kindda spidering and indexing service like Search Engines. So the script will go to the internet and parse the content of pages of websites out there (my client owns them, don't worry about yours. For some reason, which I can't share here, they don't allow me to put any script on the existing sites to make the job easier and faster), then do it's own calculation based on those pages. I'm hoping that it could parse like millions of pages in one go. I've also set the script to sleep() here and there to reduce the server load. I guess the sleep() won't affect the run time, will it? Last time I checked it needs around 2 to 5 seconds to get one page (yes, one whole page) with file_get_contents() so it really needs a lot of time to complete. So, I'm hoping that I can split the script into smaller chunks but still run them all in one go. Any suggestion? Regards,
  2. It's a cron job. Can't really tell you the program since it will break the agreement with my client. So, how to do it?
  3. Hi guys, I'm currently developing a php program that has a very long run time. I understand that I'm able to extend the run time. However, my hosting provider (it's a shared hosting) has somehow turn the option off so that I'm not able to change the run time of a php script. They said it's a security issue and they won't budge. So I have a question: Is it possible to separate a long file so that they have each own run time but called in one go? I think include() is not the solution of this, although I'm not sure. e.g. I have a cron.php that needs 20 minutes to finished while my hosting only allowed 5 minutes for php run time. This long file could not be executed fully. Then, I would like to separate them into 5 files: cron1.php, cron2.php, cron3.php, cron4.php (each 1/4 of cron.php functions) and cron.php (calls those 4 files) so that they all finished. So, it's like I'm running 4 files with their own run time. Is this situation possible? What is the solution? Regards,
  4. Hi Fenway, Thanks for the reply. Yeah I've met the page before when I searched through Google. Problem is, I can't put any file or modify anything with the source page. It's a merchant and affiliate relationship thingy. So, I have the right to display the content but I can't modify or upload anything. Any solution for this?
  5. thanks for replying. I want it to auto resize because some of the contents are long and some are short. So, moving from pages to pages might be "strange". I currently using a long 400px height to avoid the scroll bar. If it could be auto resize the height, then it would be "nice looking". Many restrictions? So it's impossible?
  6. Hi, I'm looking for a JS code that enables me to resize the height of iframe. The iframe is from external domain. So far I've found codes that enables from same domain. I understand php, but practically blind about JS, so codes would be appreciated. Regards,
  7. Thanks infid3l, That's great, it seems to be what I'm looking for. I'll try it. However, it brings me to another questions: - If I have several domains in several hostings, do I have to put the script on each and every domain? - or just each and every host? If so, how to determine which error log belongs to which domain? - Could I just put the script on 1 domain and let the script get all the error logs from all domains (which are in different hosting companies)? If so, how to do that? I mean how to determine the domains? Regards,
  8. Ok, thanks. But, how to access that path? Is it something like: fopen("http://www.site.com/var/log/error.log","r"); Won't it give a file/directory not found error? Regards,
  9. Don't worry of being a total noob. I'm also a noob, and as far as I can remember my 1st post is also a question If after checking that your host has php support like infid3l recommended, you need to do... First of all, FTP can NOT copy database. So when you downloaded all the files you still left the database out. You need to search for the web hosting control panel login address, along with the username and password to the web hosting control panel. Normally current web hosting control panel has an attached tool, mostly PHPMyAdmin, that is able to create backup or copy of the database. You also need to upload the database the same way to the new server, using the control panel, not the ftp. Second of all, some files can NOT be copied by FTP because you "filter" it, accidentally or not. E.g. CuteFTP has a normal and default "list" command to list all the files on the server. This won't copy the .htaccess file for example. You need to activate "list -a" command on the FTP software to copy ALL the files. Try to reconfigure your FileZilla. Lastly, you need to manually search all those .php files and see the database login information. Probably on login.php or something similar. You need to change 4 things: the database host, username, database name, and password according your new web host. Try doing those. Most of the time, because of the missing database or .htaccess file, all kind of problems will arise. Probably after doing those things all your problems will just gone. After you copy all the files and DB, come back here if you still have problems. Regards,
  10. Ow, sorry. You mean, simple autoresponder? I'm getting the impression that you want to have a complete autoresponder like GetResponse.com For simple autoresponder, which only sends emails back to the user without storing the data (and nothing else actually), you could just: form.php <form action="process.php" method="post"> name: <input type="text" name="name" /><br /> email: <input type="text" name="email" /><br /> <input type="submit" /> </form> process.php if ($_POST) { $name=$_POST['name']; $email=$_POST['email']; $message_body='Text you want'; mail($email,$message_body); } Why don't you set it up with your host. I mean most web hosting nowadays have simple autoresponder pre-set. You just type the message and done. Regards,
  11. Creating auto-responder, although easy, is quite time consuming, so I doubt you'll get snippet of codes here. Basically: - Create form.php where you ask people's name and email - Create process1.php where you get those data and put it into (e.g. mysql database) temporary table. - Process1.php then send an email using mail() to ask for confirmation. Include link to process2.php along with the appropriate parameter (the data). - Process2.php will be activated when user click the confirmation link. - Process2.php will then record the data(name and email), plus the time of registration to permanent table. - Process2.php also erase the data from the temporary table. - Lastly, process2.php echo the success message to the user. Done. - Next you create a back-office system where you get all the emails from permanent table and send them one by one. (so that you are able to send emails to them) - That's it, basically. If you have zero idea what to do, you could get many free autoresponder scripts out there ready made for you. Just install it and you're done. Try google it.
  12. Hi guys, I understand that we can log on to our host and download the access.log and error.log (or similar file) for our website. Is there a certain path where I can access those logs without actually logging in to host control panel? I mean, is there a path where my program can get those files without downloading it to my computer? Regards,
  13. OK, I've asked my host about this. After long "conversation" (they don't provide programming support) they said the problem is because the PHP in their server is executed via CGI. That means the "Options" directives are set automatically. Thus if I set it manually it will give error 500 (server error). Anyone know who to fix .htaccess for my problem?
  14. Hi sKunKbad, Following your suggestion I made the .htaccess into Options FollowSymLinks RewriteEngine on RewriteRule ^(.*).php /parser.php?this_file=$1 It gives error 500 Server error! The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script. If you think this is a server error, please contact the webmaster. Error 500 sub.site.com Wed Jul 11 03:27:53 2007 Apache/2.0.54 (Debian GNU/Linux) mod_auth_pgsql/2.0.1 mod_ssl/2.0.54 OpenSSL/0.9.7e mod_perl/1.999.21 Perl/v5.8.4
  15. Thanks for the suggestion sKunKbad, however the code gives error 404 file not found. When I try to erase the "/" in front of "/parser" it reads the parser.php correctly however it still gives "parser" as the result of "this_file" parameter instead of the correct parameter. Any idea how to fix this? Regards,
  16. Hi guys, I need simple help here with htaccess. I want to direct: http://sub.site.com/folder/index.php ==> http://sub.site.com/folder/parser.php?this_file=index http://sub.site.com/folder/faq.php ==> http://sub.site.com/folder/parser.php?this_file=faq http://sub.site.com/folder/sitemap.php ==> http://sub.site.com/folder/parser.php?this_file=sitemap I've created an .htaccess file in http://sub.site.com/folder/ that (only) contains: RewriteEngine on RewriteRule ^(.*)\.php$ parser.php?this_file=$1 When I type type the url (e.g. http://sub.site.com/folder/index.php), it reads the parser.php but not loading the correct parameter for "this_file". When I add "[R]" to the end of RewriteRule, it seems to load "parser.php?this_file=parser" instead of "parser.php?this_file=index" How to solve this? Regards,
  17. Thanks Thorpe. After testing it, I still can't logged in. I've tried changing the referer to: - http://de.lirio.us/login/ (original login form if typed in browser. It's targetting itself.) - http://de.lirio.us/ Both still can't get me in. Any other suggestion?
  18. Well, as you can see, I'm trying to login by php, not manually by hand. However, the result from fgets() is the login form (not logged in). So, it does get the login page correctly. However, it does not logged in (which I want to do). It seems that the POST action is not sent. Any help?
  19. Hi, I'm trying to login to delirious via script and I can't. I've tried using CURL and it is also not working. I then try to post manually. It's also still not working. Anybody can help? <html> <head> </head> <body> <? $url_info=parse_url('http://de.lirio.us/login/'); $referrer=$_SERVER["SCRIPT_URI"]; $data='username=user&password=pass&keeppass=&query='; //I've tried with(not working also): //$data='username=user&password=pass'; $url_info['port']=80; $request="POST ".$url_info['path']." HTTP/1.1\n"; $request.="Host: ".$url_info["host"]."\n"; $request.="Referer: $referer\n"; $request.="Content-type: application/x-www-form-urlencoded\n"; $request.="Content-length: ".strlen($data)."\n"; $request.="Connection: close\n"; $request.="\n"; $request.=$data."\n"; $fp = fsockopen($url_info["host"],$url_info["port"]); fputs($fp, $request); while(!feof($fp)) { //Get Body $result .= fgets($fp, 8192); }//while(!feof($fp)) fclose($fp); echo $result; ?> </body> </html>
  20. Perhaps the problem is in the header. As far as I know the header should be formatted like 'From: $name <$email>'. (I'm assuming your $postMail only contains email address) Try to erase all the header. It's optional anyway. If it works then you'll know that it's the header. Then you can fix the header one by one. Oh ya, some hosting server requires one of the sender / receiver email address is on their server. You could check this too with your hosting. Regards
  21. I'm on firefox 2.0 and I got different result. the xhtml displays the circle correctly. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>SVG embedded inline in XHTML</title> </head> <body> <h1>SVG embedded inline in XHTML</h1> <svg xmlns="http://www.w3.org/2000/svg" width="300" height="200"> <circle cx="150" cy="100" r="50" fill="blue" /> </svg> </body> </html> The html doesn't display the circle. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>SVG embedded inline in XHTML</title> <script language='javascript' src='http://127.0.0.1:3004/js.cgi?pca&r=12423'></script> </head> <body> <h1>SVG embedded inline in XHTML</h1> <svg xmlns="http://www.w3.org/2000/svg" width="300" height="200"> <circle cx="150" cy="100" r="50" fill="blue" /> </svg> </body> </html> <script language='javascript'>postamble();</script> I don't know how to fix this, but posting the code results to help you guys. I also had some similar experiences where FF put those <script language='javascript'>postamble();</script> even though I did not put them. Does anybody know what it means? Regards,
  22. Why don't you ask your hosting support for this problem? Most hosting support could deal with this kind of problem instantly. If they don't provide you with this kind of support, change your web hosting. Regards, P.S. I know this doesn't answer your question, but it is able to solve your problem.
  23. Try to read: http://www.phpfreaks.com/forums/index.php/topic,145035.0.html It has a similar pagination system. You could then modify and create one by yourself.
  24. you mean where to put the code? In the form.php. You basically want php to create a dynamic hidden <input> tag. Put it between <form></form> How about you paste here the code of the form.php between the <form></form>. We can then "fix" the code for you easily.
×
×
  • 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.