|
Alright I am a total newb at PHP and coding, and frankly I can't wrap my head around it. But I'm having a problem:code:
This correctly keeps the log, but it won't block the user out. What am I doing wrong?
|
# ¿ Mar 25, 2008 03:48 |
|
|
# ¿ Apr 29, 2024 17:46 |
|
Wow, that was easy. Thank you sir!
|
# ¿ Mar 25, 2008 04:11 |
|
Okay, now how would I display inline the amount of time remaining per IP? For example, taking the ip log recorded from above and in a new page I would have: code:
Treytor fucked around with this message at 05:02 on Mar 25, 2008 |
# ¿ Mar 25, 2008 04:31 |
|
admiraldennis posted:I'm assuming he's just trying to learn how to program or something, not implement this (I hope). Well... I am looking to implement this. I realize a sql database would be much better, but that is WAY beyond me at the moment. One step at a time here...
|
# ¿ Mar 25, 2008 04:46 |
|
admiraldennis posted:You sound like you're in a little bit over your head here. Yeah, you're right. The problem is I don't have any resources to hire anyone, and I'm also fairly interested in learning a bit about this stuff. If this site proves a worthy venture, then I'll look into more appropriate options down the road.
|
# ¿ Mar 25, 2008 09:30 |
|
I have since upgrade to PHP 5 and it seems my method of querying a server via a predefined URL no longer works:code:
|
# ¿ Mar 29, 2008 21:45 |
|
Yeah, to be honest I wasn't even using fopen before. Thanks!
|
# ¿ Mar 29, 2008 23:42 |
|
I suck at PHP, I admit. All I really know how to do is modify code already given to me, and somewhat follow what is going on. Anyway, let me cut to the chase. How do I do this: code:
|
# ¿ Apr 1, 2008 03:13 |
|
Thanks for the input. I was also told that something like this would work as well: http://netevil.org/blog/2006/nov/http-post-from-php-without-curl But I am having a hard time wrapping my head around what to do, exactly. Like I said, I'm only into PHP about a week here, and I'm still trying to remember where to put the semicolons edit: This is what I've got: (ignore the stupid echo's I have in there) code:
code:
What am I missing here? The original code works perfectly on a server that supports curl, but that isn't an option... EDIT 2: It seems my server is being a bitch... Treytor fucked around with this message at 04:58 on Apr 1, 2008 |
# ¿ Apr 1, 2008 03:55 |
|
This is an ip logger and checker, which outputs to a text file on the server. Is there a more efficient way to do this? Say for example if my site was getting hammered and my host was complaining about the PHP slowing down the entire server...code:
Treytor fucked around with this message at 03:36 on Apr 2, 2008 |
# ¿ Apr 2, 2008 03:12 |
|
This isn't on my web host, and I don't have (free) access to the crontab on the server. I realize this would work better in a DB, but that's beyond me at this point. Time is pressing and I would think if the script just deleted any entry older than the time specified it would help keep processing cost down? EDIT: Here is the script edited a bit, and this is what will get run repeatedly as people refresh like mad. What line do I throw in there to check to see if a time stamp is $timeout older than $now? And if so, delete that entry. code:
Treytor fucked around with this message at 04:18 on Apr 2, 2008 |
# ¿ Apr 2, 2008 03:51 |
|
duz posted:Instead of using explode and what not, look up fgetcsv and fputcsv. Can you chat on gmail?
|
# ¿ Apr 2, 2008 04:31 |
|
Okay I've got a question. I have a form that I want filled out, but I want a hidden field to be randomized.code:
Any thoughts on how this could be accomplished? edit: I think I figured it out! code:
Treytor fucked around with this message at 08:49 on May 24, 2008 |
# ¿ May 24, 2008 08:24 |
|
I have a file upload script based on this - http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=2293&lngWId=8 but I need it to remove spaces in the file names before it uploads it to the server. How would this be done?
|
# ¿ Jun 17, 2008 20:33 |
|
duz posted:str_replace actually. He got a hold of me via IM and got it worked out. Yes. Thanks again! Also thank you bt for your input as well!
|
# ¿ Jun 17, 2008 22:34 |
|
Could a PHP script be used to ping a server, and redirect to two different pages depending on whether the pinged server responds or not?
|
# ¿ Jun 19, 2008 18:37 |
|
fletcher posted:PEAR Ping Thanks for this, but I am having problems getting PEAR to work with my web host, I think they may be blocking some functions required by PEAR to operate... Is there any other option (preferably without requiring a framework?) I found this script here: http://www.greenbird.info/xantus-webdevelopment/ping Which seems to work on their site, but when I upload it and test on my own server, I'm getting a reported ping response from all servers, including the fake one... Treytor fucked around with this message at 08:58 on Jun 22, 2008 |
# ¿ Jun 22, 2008 08:39 |
|
How do I pause a PHP script? I've played with the sleep(); function, but it seems to 'lock' the rendering of the page until the sleep timer is up. I want to set variables -> render a web page -> *wait 2 minutes* -> then execute code using the variables set earlier. Is this possible?
|
# ¿ Jul 18, 2008 20:37 |
|
Thanks again for your feedback, guys. I don't really understand that fork thing, but am willing to give it a shot (I'm very new to PHP). This application is not mission critical, so worrying about server crashes is minimal. I've also tried the flush(); thing, but that's still preventing the page from loading. Here is what I have: code:
EDIT: I don't have terminal access or to a cron job, as this is fairly basic web hosting. A cron wouldn't be frequest enough, anyway as I want this to run exactly 2 minutes after page load. With a cron, there could be a minute delay if they page load right after the last cron goes through. Treytor fucked around with this message at 00:27 on Jul 19, 2008 |
# ¿ Jul 19, 2008 00:24 |
|
jasonbar posted:No sir, flush AFTER the html, right BEFORE the sleep(). Here is a working example: http://burntmail.net/flush.php Would PHP being in safe mode interfere with this at all? Your script works perfectly on your page (obviously), but if I copy that code exactly and run it on mine, the page doesn't load until after sleep is done.
|
# ¿ Jul 19, 2008 01:05 |
|
jasonbar posted:
This is working perfectly, thank you! Now to answer your question as to what I am doing, exactly: http://www.ecarddialer.com Thanks again! Treytor fucked around with this message at 11:55 on Jul 23, 2008 |
# ¿ Jul 19, 2008 05:37 |
|
Is there any way to pass a variable from one page to another within PHP without it being visible to the end user or using a database?
|
# ¿ Apr 2, 2009 00:17 |
|
Is there an easy way to mask the source of a download link? For example, I have an file at http://192.168.0.1/soundfile.mp3, but I want it to appear to be coming from http://www.example.com/soundfile.mp3 Can this be done easily? Thanks
|
# ¿ Aug 11, 2009 10:09 |
|
Yes you are correct on your assumptions. I guess I just have no idea how to do what you're saying, but it's promising to hear that it is possible.
|
# ¿ Aug 11, 2009 12:40 |
|
|
# ¿ Apr 29, 2024 17:46 |
|
Thanks again for the help, I really appreciate it. The two servers in question here are not on the same network, but are both web accessible. I don't want my end user to be aware of the IP address server, only the domain name.
|
# ¿ Aug 11, 2009 21:18 |