Jump to content

laffin

Members
  • Posts

    1,200
  • Joined

  • Last visited

Everything posted by laffin

  1. u can do that a number of ways <?php $body = "Content i want to keep content i want to keep <flag> content to wipe over content to wipe over"; if(($found_flag=strpos($body,'<flag>'))!==FALSE) $body=substr($body,0,$found_flag) . "This is my new content "; echo $body; ?> shud output Content i want to keep content i want to keep This is my new content
  2. this is kinda simple as it dun check for anything but what ya have given preg_replace('@<a href=[\'\"]([^\s]+)[\'\"]>.*</a>@im','$1',$body);
  3. u may have to look at this function as well prepare_sql_select($details,$table,$whereclause,$orderby);
  4. it's called cron, u set the intervals and what command to run at those intervals
  5. laffin

    bbcode help

    ya mean yer info is already converted to html, and u need it to go back to bbcode? that's pretty complicated order, as different bbcodes output different information. prolly the easiest way is to add html comments before and after each bbcode converstion. example: [url=http://www.google.com]google[/url] usually wud output <A HREF="http://www.google.com>google</A> but if u added html comments u can make yer job easier if it looked like <!--- bbcode: [url=http://www.google.com] --><A HREF="http://google.com"><!--- bbend -->google<!-- bbcode: [/url]></A><!--- bbend --> Yes it may add a lot of clutter, but will make reconstructing the original bbcoded message a whole lot easier
  6. depends on the authentication method cookies or https for https ya can put the username/pw on the url string https://site.com@user:pw/path/ I believe the format is for cookies ya will prolly opt for using curl (as fopen wud be a lot of code) [http://www.weberdev.com/get_example-4555.html]using curl with cookies example[/url]
  7. it's called a preview done in ajax or javascript
  8. datetime is a mysql reserved word, either encase it in `back quotes` or change the db fieldname
  9. i dun see an error message to display, just the default page main.htm u shud also consider checking for '..' in the page names as well as '/' otherwise ppl gonna do all sorts of crazy things $level = isset($_GET['level'])?(preg_match("@[^/.\s]@",$_GET['level'])?$_GET['level']:''):''; $course = isset($_GET['course'])?(preg_match("@[^/.\s]@",$_GET['course'])?$_GET['course']:''):'';
  10. $_POST is an array of variables already. if yer outputting to a file. u wud want a recursive function to differentiate between arrays and strings. so yer question is kinda lacking. $post=$_POST;
  11. looks like he trying to get the words, seperated which $words=explode(' ',$string); wid work thus echo $word[0] wud print out 'this'
  12. u were supposed to extract the php.zip file with folders. sounds like u unzipped without the paths, thus ya got everything in one folder.
  13. windows dusn offer the nicety of having Shebang. you will have to give it the php cli as well.
  14. i wudda opted for sumfin like preg_match("@Uploaded:(?:<.*>)(\d{1,}.\d{2}) ([bGMTK]{2})@i",$data,$matches)
  15. if yer processing so much info that it's noticeable by a wristwatch. than it's not a question if ob commands causing a bottleneck in yer app. it's a question of how do u optimize yer code. pages shudn take more than a few secs to load.
  16. oops forgot some more things on it <?php // turn on buffering ob_start(); // do our page thing echo "this will diaply in yer window"; // get the buffer and length $output=ob_get_contents(); $olen=ob_get_length(); // stop buffering ob_end_clean(); // tell browser when how big the contents of our page is if($olen<256) {$output = str_pad($output, 256);$olen=256;} // IE Hack header("HTTP/1.1 200 OK"); header("Content-Length: $olen"); //output the page echo $output; // the following shud not display in the browser, reason using the file sample.txt as proof it continues processing $fh=fopen("sample.txt","w+"); fwrite($fh,$msg="This shud not display in yer window, thus the script is still executing\n"); fclose($fh); echo $msg; ?> that shud work
  17. <?php // turn on buffering ob_start(); // do our page thing echo "this will diaply in yer window"; // get the buffer and length $output=ob_get_contents(); $olen=ob_get_length(); // stop buffering ob_end_clean(); // tell browser when how big the contents of our page is header("Content-length: $olen"); //output the page echo $output; // the following shud not display in the browser, reason using the file sample.txt as proof it continues processing $fh=fopen("sample.txt","w+"); fwrite($fh,$msg="This shud not display in yer window, thus the script is still executing\n"); fclose($fh); echo $msg; ?>
  18. depends on the route ya needs Confirmation of Emails - works if yer keeping user accts Domain checks - works but dusn verify an existing email acct
  19. querying the domain a nice article can be foune here email confirmation, you can find a bunch of tutorials on
  20. u define the handle with opendir such as handle=opendir("path/to/list");
  21. that's what i say a lot here too, ya learn something from different ppl.
  22. <?php isset($_GET['critter']) && $critter=$_GET['criiter']; (strpos($critter,'..')) && $critter=NULL; (isset($critter) && !is_dir($critterdir="images/$critter")) && $critter=NULL; if(empty($critter)) header("location:http://my.site.com/unknown.html"); $dh=opendir($critterdir); while($file = readdir($dh)) { if(is_file($file) && preg_match("@^.*\.(?:jpeg|jpg|gif)$@i",$file) && filesize($file)>(1024*10)) { echo "<IMG SRC=\"$critterdir/$file\"><BR>"; } } closedir($dh) ?> this shud work. header("location:http://my.site.com/unknown.html"); remember to change location, to page with unknown critters. the stuff before that checks for valid folder info. if(is_file($file) && preg_match("@^.*\.(?:jpeg|jpg|gif|png)$@i",$file) && filesize($file)>(1024*10)) { a fun line, makes shure we not looking at a folder, makes shure it is a image format than check the filesize (1024 = 1K * 10 = 10k) hope that helps. any possibility ya can pass me the url, would be neat to see what u do with the script
  23. array_count_values
  24. thats the thing it gets it off the website like that. if sent to a browser it will look fine, sent anywhere else ya will see the actual page coding without interpretation. use htmlspecialchars_decode function to convert it into a displayable src
  25. yer php script sez if ($_GET['tn'] > $result['TicketsOnSale']) { yet in a string comparison it will be either == or != not > and < if ya want to use < or > use strcmp function otherwise make shure 'tn' is a number as define it as so.
×
×
  • 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.