Jump to content

sKunKbad

Members
  • Posts

    1,832
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by sKunKbad

  1. Sorry, I had to go leave, but now that I am back, I had a little more time. As long as the number of characters after "http://www.youtube.com" is 20, you could use this: <?php $flashMovie = '<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/SpJUj626qCc&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/SpJUj626qCc&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>'; $subject = "$flashMovie"; $pattern = '/http:\/\/www\.youtube\.com.{20}/'; preg_match($pattern, $subject, $theMatch); echo $theMatch[0]; ?>
  2. <?php $flashMovie = '<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/SpJUj626qCc&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/SpJUj626qCc&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>'; $subject = "$flashMovie"; $pattern = '/http:\/\/www\.youtube\.com.*\"/'; preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE, 3); print_r($matches[0][0]); ?>
  3. put the session_start at the very top of the script after <?php
  4. After reading, I believe the Mail package goes inside the /PEAR/ directory, but when I try to upload it there, my FTP client says, "critical transfer error", and nothing happens.
  5. I don't know if this fits into this category, but I need help installing the pear package "Mail" with FTP to a shared host. I have the zipped Mail package, and it has the following inside: /Mail/ /tests/ Mail.php Pear is installed outside my public_html folder, and inside /pear/ I see: /bin/ /PEAR/ /temp/ index.php pear.conf I'm assuming I can use FTP and upload the contents of the zipped mail package somewhere, but I want to make sure they end up in the right place.
  6. you may have to encase the contents of the xml in cdata tags
  7. Although there are many threads/posts asking about shared web hosting suggestions, I thought it would be beneficial to hear from the more experienced phpfreaks members regarding specific questions. I'm looking to change hosts, and am considering questions like: 1) What version of php? I'd prefer a 5.2.X installation. Many hosts don't keep their php installations current or even close to current. 2) Where is customer support located? I'd prefer somebody that doesn't have a strong accent. (I speak english, and am in USA). 3) Is mod rewrite available? Am I able to utilize .htaccess files, and what am I allowed to override? 4) How many domains can share the same hosting account? I need 3 for right now. 5) Are PEAR modules/packages installed? Can they be installed? 6) Beyond the bare bones php installation, are there extra php extensions installed? 7) Will technical support be a joke, like Godaddy, who's default answer to any question is, "It must be your custom script, and we don't help with that unless you pay us $70 an hour". How many MySQL databases are available? I'd like to be told if there are other important questions to consider. I've worked with godaddy, ixwebhosting, bmc, yahoo, and quiltropolis web hosting, and am considering going back to ixwebhosting, but would like some input before making the decision. One thing that I liked about Godaddy was that when the site did work it seemed really fast, but their downtime and the amount of technical issues I've had with them in the last year is unacceptable. I'm not really interested in having everyone just list their favorite host. It might be better to have people list their favorite host and ALSO LIST reasons why other hosts really sucked. Thanks for your input.
  8. I called Godaddy and even after having their admin review the incident they claim the problem is with my "custom scripting"! Unless I can get this fixed right away, I'm going to be changing hosts. So, I'm now either looking for a fix, or a hosting recommendation.
  9. I'm getting a 500 Internal Server Error occasionally when this loads: <?php header("Last-Modified: " . gmdate("D, d M Y H:i:s", getlastmod()) ." GMT"); ?> <html> <head> <title>Godaddy 500 Internal Server Error</title> </head> <body> <p>Everytime second time you load this page, you will get the 500 Internal Server Error from Godaddy</p> </body> </html> IE gives the error every time I loaded it. Firefox every other time. Safari and Opera were fine. I don't want to disable browser caching, and I don't want to send a 304 status header if the page hasn't been modified. The reason for this is because I use a sitemap program that needs the last modified header to output the real last modification in the sitemap. What's up with this 500 internal server error? Is there some other reliable way to send the last-modified header? Thanks
  10. Unfortunately I do not have the required forum permissions to ban by IP, or do anything creative with regex. The forum is a vBulletin forum, and I'm a "SuperModerator", but its really not that super! I can only ban manually.
  11. I don't know about that. I moderate for a forum where Russian spammers are creating accounts like crazy. I'm pretty sure they use bots for account creation, including the acquisition of new email accounts from gmail, yahoo, hotmail, etc. There are definitely some very sophisticated bots out there.
  12. Change your if statement if($userInfo->pic !== NULL)
  13. Thanks for clearing that up. I am seeking out a new host, and that was something I was wondering about.
  14. So, if you have dedicated hosting that isn't managed, does that mean you personally go in and manage the server?
  15. What is "managed" hosting? Is this the same as shared hosting?
  16. I have a need to strip out \r\n AND \t, but can't use \s or my string becomes unusable. Right now I have: $menu=preg_replace("|\r\n|", "", $menu); $menu=preg_replace("|\t|", "", $menu); It doesn't seem like it would be efficient, but I don't know of any other way to do what I need to do. Is this OK?
  17. When I ran your tests just now, there was a four tenths of a second difference, and memory usage was the exact same. I think it is VERY unlikely that the difference is great enough to effect the user's experience of any of my pages. While I do agree there your tests prove that heredoc is slower than double quotes when looped 10000 times, in the case of normal usage the difference is probably indistinguishable. Let's not quibble over such a minute amount of time! Saying , "heredoc is very inefficient. Avoid using it.", is a bit of an exaggeration.
  18. I'm not saying your wrong, but why do you say that?
  19. This might work for you <?php if ((!isset($_SERVER['PHP_AUTH_USER'])) || (!isset($_SERVER['PHP_AUTH_PW']))) { header('WWW-Authenticate: Basic realm="Secured Area"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else if ((isset($_SERVER['PHP_AUTH_USER'])) && (isset($_SERVER['PHP_AUTH_PW']))){ if (($_SERVER['PHP_AUTH_USER'] != "calcuser") || ($_SERVER['PHP_AUTH_PW'] != "testpwd")) { header('WWW-Authenticate: Basic realm="Secured Area"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else if (($_SERVER['PHP_AUTH_USER'] == "calcuser") || ($_SERVER['PHP_AUTH_PW'] == "testpwd")) { echo "<h1>Welcome Friends!</h1>"; } } ?>
  20. unset($_SESSION['order'][$key]['productnumber']);
  21. How about creating a static array in the foreach loop and add each $item to the array. Then use an if statement to delete each $item if it is already in the array.
  22. I believe when you store the html link in the database you need to add slashes before quotes, and then when you print the results of your query to the database, remove the slashes.
  23. sKunKbad

    .htaccess

    asmith, just go in to your httpd.conf file and in the two places you see: AllowOverride None change them to AllowOverride All and you are good to go.
  24. After messing around with htpasswd.exe in the command prompt, and reading the documentation, I have come to realize that the -d option (crypt) is not usable/available on WAMP. If I am wrong I would be very happy.
×
×
  • 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.