
ManiacDan
Staff Alumni-
Posts
2,604 -
Joined
-
Last visited
-
Days Won
10
Everything posted by ManiacDan
-
First iteration of foreach much slower than rest
ManiacDan replied to lonewolf217's topic in PHP Coding Help
You may have read about it in my article on it here. There are some tricks in that article (like assigning a fake reference to the variable) to cut down on the copy size and memory usage. -Dan -
There isn't much more to say to this, I already gave the whole list. If you don't think "is port 80 responding" is enough of an indication of "up," then...go down the list. When I wrote the monitoring for softlayer, those were the levels we offered: Ping, tcp connection, tcp response, parsed string response. (plus a lot more for non-web servers, but that's the web stack)
-
But if the web service returns a 503 with every request, is that "working?" That's the question. What constitutes a "working" website? If you just want to know if the server is turned on, use ping. If you just want to know if apache is running, use curl with no check. If you just want to know if PHP is working, use curl with preg to pull specific items off a known good page. If you just want to know if the whole end-to-end website is working, perform activity on the site (creating content, changing menu options) and check their results with multiple sequential calls from cURL or some other page-fetching tech. -Dan
-
As you've discovered, the developer needs to manually add that information to their site in order for people to know it. You cannot get the active connection count for another server without their developers specifically allowing for it. Also, please try to write good questions and good thread titles. You posted a thread called "PHP CODING HELP" into a forum called "PHP Coding Help"
-
Ping only tells you if there's a working OS at the other end of the line. cURL only tells you if the web server is serving SOMETHING, not necessarily the page itself. You need to combine curl with grep (or preg or whatever) and ensure that the page CONTENTS are coming through. If I wanted to check if PHPF were up, I would check for the phrase "Page Created In" because that only shows up in the footer and only on successful page load.
-
As much as I hate the phrase RTFM, go do it.
-
Look into regular expressions or the DOM object. You will probably have to write a separate spider for each site unless you're very talented.
-
And what country will you be in? What country will your clients be in? What country will the server be in? Will you be paying cash for these play credits? Is it a standard game of chance or is it a game of skill? You should ask a lawyer these questions, since it's very complicated (as you can see)
-
Problem with white spaces on image file upload?
ManiacDan replied to simmsy's topic in PHP Coding Help
It's not stripping anything, tag attributes must be quoted. "<div id='profileimage'><img src=\"".$image."\" width='200px' height='200px'></div> " -
Problem with white spaces on image file upload?
ManiacDan replied to simmsy's topic in PHP Coding Help
Perhaps you don't understand what we're asking. The code you're showing us is used to move the uploaded file to a permanent storage location. You need to show us code that includes an <img> tag, that's the code that displays the image. -
Sessions are stored using cookies, and the cookie depends on the subdomain. You'll have to use session_set_cookie_params to force your subdomain to cookie for the whole site.
-
We can't see your screen, we don't see any spaces in any of your variables.
-
Are you sure the address is correct? Have you printed it out and copy/pasted it into a browser?
-
You can't redirect a customer to one URL but show them a page from a different URL. The URL is the address of the page you're viewing. You can use mod-rewrite to change one URL to a different file.
-
Don't use header redirects then. Have the under contructions page be a template or a PHP include. At the very top of your index, check to see if the site is in maintenance. If it is, include the maintenance template and die.
-
Problem with white spaces on image file upload?
ManiacDan replied to simmsy's topic in PHP Coding Help
That's the same code you already showed us, and it's not (1) getting image name to display, or (2) displaying the image -
Then I'm not understanding the problem. Your code says "if they came from post_new, send them to post_new. If they came from logged_in, send them to logged_in."
-
Why do you have the IF/ELSEIF statement at all? Why not delete the whole thing and use the HTTP_REFERRER directly in the header?
-
Problem with white spaces on image file upload?
ManiacDan replied to simmsy's topic in PHP Coding Help
What do you mean they don't show up in the browser? -
header reditect and http_referrers are full URLs.
-
Inside your while loops, check to see if the value. if it's empty, don't echo.
-
This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=352281.0
-
Within these lines that you posted, scatter echo or var_dump statements that show the contents of the variables. Check to see if they're what you think they're supposed to be. Make sure the query is correct.
-
There's two things wrong with it: 1) There's no error-handling code 2) Nobody tried to debug it. Are you absolutely 100% certain that the value coming into this function is a number? Are you sure you even have error_reporting turned on?
-
The political discussion that had started in this thread is now split into its own thread. Please use this thread to discuss domain registrars and web hosts only.