laffin
Members-
Posts
1,200 -
Joined
-
Last visited
Everything posted by laffin
-
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
-
this is kinda simple as it dun check for anything but what ya have given preg_replace('@<a href=[\'\"]([^\s]+)[\'\"]>.*</a>@im','$1',$body);
-
u may have to look at this function as well prepare_sql_select($details,$table,$whereclause,$orderby);
-
it's called cron, u set the intervals and what command to run at those intervals
-
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
-
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]
-
Hey one hard question i dont know where to put it so here it is :
laffin replied to yanivkalfa's topic in Javascript Help
it's called a preview done in ajax or javascript -
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']:''):'';
-
$_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;
-
looks like he trying to get the words, seperated which $words=explode(' ',$string); wid work thus echo $word[0] wud print out 'this'
-
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.
-
windows dusn offer the nicety of having Shebang. you will have to give it the php cli as well.
-
i wudda opted for sumfin like preg_match("@Uploaded:(?:<.*>)(\d{1,}.\d{2}) ([bGMTK]{2})@i",$data,$matches)
-
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.
-
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
-
<?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; ?>
-
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
-
querying the domain a nice article can be foune here email confirmation, you can find a bunch of tutorials on
-
u define the handle with opendir such as handle=opendir("path/to/list");
-
that's what i say a lot here too, ya learn something from different ppl.
-
Inserting mages into a page from a certain directory
laffin replied to nubble's topic in PHP Coding Help
<?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 -
array_count_values
-
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
-
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.