Jump to content

pkSML

Members
  • Posts

    191
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://pksml.net

Profile Information

  • Gender
    Male
  • Location
    Bucyrus, Ohio

pkSML's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. $string_exp = "@^[a-z .'-]+$@i"; if(preg_match($string_exp,$first_name) == 0) { $error_message .= 'The First Name you entered does not appear to be valid.';} Give that a whirl. Edit: added the "i" PCRE switch to make it caseless.
  2. Yes, you are correct. But since they're calling the page by a frame, couldn't you just adjust the frame HTML code? for instance <iframe src="http://pawlectros_site.com/?referrer_id=73825" width="100%" height="300">
  3. Woops! I thought you were just discarding everything after the last dot. @thebadbad - nice to see there's another way of doing things, probably closer to 'best practice' Anyhow, here's how my code changes now that I understand what you needed to happen. <?php $pos = strrpos($str, '.'); // this will give us the position of the last dot in the string -- strpos() will give you the first occurrence $newstring = substr($str, 0, $pos) . preg_replace("/[^a-zA-Z0-9]/", "", substr($str, $pos)); // You'll have $newstring, which contains everything up to the last dot and all alphanumeric characters after the last dot in the string ?>
  4. You should be able to do that with strpos and preg_replace in PHP. <?php $pos = strrpos($str, '.'); // this will give us the position of the last dot in the string -- strpos() will give you the first occurrence $newstring = preg_replace("/[^a-zA-Z0-9]/", "", substr($str, 0, $pos)); // You'll have $newstring, which contains all alphanumeric characters from the beginning of $str until the last dot in the string ?>
  5. Put your span tag inside the a tag. <td><? echo "<a href=\"profile?user=$session->username\"><span class=\"style10\">Profile</span></a>" ?></td>
  6. Maybe you could give us the URL to see if we get the same errors. What browser are you using? Try a different browser. Otherwise, make sure you've actually saved the php file on the server. Might as well check the basics!
  7. Try the code here: LitlURL link
  8. Yah. Give me a few minutes. I'm tweaking the code. BTW, what file types will you mostly be downloading? mp3, png, jpg, gif, etc???
  9. What exactly are you trying to do? 1. Server downloads file Then: Server pipes file to user to download?
  10. What exactly is that old query error? Could you show us the snippet of code that still gives you this error?
  11. Actually, check out this link: LitlURL link Use strlen($data) rather than filesize() You'll need to manually set the filename of whatever they're downloading.
  12. Specify the content-type in a HTTP header. (You'll have to have an array of extensions mapped to content-types.) Then readfile($data); You will need extra headers to make the save file dialog box come up. You can google that too: Download file headers cross-browser
  13. Run the command line (Start --> Run --> cmd.exe) navigate to the directory with the script in it. find the location of your php.exe. type in something like this: c:\php5\php.exe -f spider.php
  14. PS If you need more help, put an example of what $invite_emails looks like in [ code ] tags.
  15. You should check out your favorite friend, Google Anyways, found this script here. <?php $url = 'http://www.assistprogramming/image.jpg'; $curl_handler = curl_init(); curl_setopt($curl_handler, CURLOPT_URL, $url); curl_setopt($curl_handler, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_handler, CURLOPT_BINARYTRANSFER, 1); //return the transfer in a binary format . $data = curl_exec($curl_handler); curl_close($curl_handler); // Do whatever you want to with $data - it holds the binary content ?>
×
×
  • 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.