Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. ok try this simpler example, get this to work first. $test = open("/VertrigoServ/www/home/yoursite/public_html/Select2a.php","r"); $result = fgets($test, 4096); echo $resultl what exactly are you trying to do ? test #2 echo file_get_contents("/VertrigoServ/www/home/yoursite/public_html/Select2a.php");
  2. whats wrong with using explode("\n", $article) ?
  3. welcome, please click solved
  4. what about explode to break them up. then use foreach on the array explode ie (this is by spaces not CR but you get the idea) <?php $pizza = "piece1 piece2 piece3 piece4 piece5 piece6"; $pieces = explode(" ", $pizza); foreach($pieces as $p) { echo "<div name='Blar'>"; echo $p; echo "</div>"; } ?>
  5. try this <?php $info = "<font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\"><strong>Name: </strong>".addslashes($name[1])."<br></font></a></font>"; ?> addslashes
  6. $fh[$p] = popen("/VertrigoServ/www". "/home/yoursite/public_html/" . $scripts[$p] ." " . $url,"r"); will fail as its not a valid path (mainly due to the space) try $fh[$p] = popen("/VertrigoServ/www/home/yoursite/public_html/".$scripts[$p],"r");
  7. try this <form method="post" action=""> <textarea name="textarea">MyNameIsJohnMc LoudAndIam3040</textarea> <input name="submit" type="submit" value="submit" /> </form> <?php if( isset($_POST['submit']) ) { //Leaves a space //echo preg_replace('#\n#sim', '', $_POST['textarea']); //clears the space echo preg_replace('#\s?\n\s?#sim', '', $_POST['textarea']); } ?>
  8. my test was echo "~$c~" so if a newline appeared i would get ~ #~ easy mistake to make (been their got all the t-shirts)
  9. use CURRENT_TIMESTAMP or NOW() ie mysql_query("UPDATE `php_blog` SET `timecode` = 'NOW()' WHERE `id`='1'");
  10. erm.. worked for me <?php $text = "# hello world"; $text = explode(' ', $text); $c = current($text); if( $c == "#" ) { echo 'test'; } ?>
  11. try <?php $string = "Some text [img=http://www.image.com/image.jpg] again some text ..."; echo preg_replace('#\[img\](.*)\[\/img\]#i', '<img src="$1">', $string); ?> also search forum for BBcodes
  12. global variables = secuirty risk, server was probably php 4 (which will not be around for long) your best bet is just to fix it. if you don't have the time then the freelance section may help
  13. Its not a problem with the VERSION, please read the posts over again!
  14. try this <?php Header("Content-Type: image/gif"); $ign = 'IGN: '.$_GET['ign']; $lvl = 'Level: '.$_GET['lvl']; $job = 'Job: '.$_GET['job']; $wld = 'World: '.$_GET['wld']; $myimage = ImageCreateFromGif('images/signature'.$_GET['image'].'.gif'); $colour = imagecolorallocate($myimage, 255,0,0); //changed ImageString($myimage, 3, 12, 10, $ign, $colour); ImageString($myimage, 3, 12, 32, $lvl, $colour); ImageString($myimage, 3, 12, 54, $job, $colour); ImageString($myimage, 3, 12, 76, $wld, $colour); ImageGif($myimage); ImageDestroy($myimage); ?> **untested
  15. What do you mean by "Call", heres you basic options include("file.php"); require("file.php"); include_once("file.php"); require_once("file.php"); but if you need to use one of the above before you make call to any functions,
  16. you sure the problem isn't in "simpletest/unit_tester.php" or "simpletest/reporter.php"
  17. what about <?php $subject = "m1 4bu becomes m1 ol8 9ez becomes ol8 ec3 9dz becomes ec3"; $result = preg_replace('#(\w{1,2}\d{1})\s\d{1,2}\w{1,2}#i', '$1', $subject); echo $result; ?> EDIT: corrected
  18. how much do you know about the project ? you seam to be missing a few details ie ########0 could just be the formatting ie ########0 = zero #####1.10 = 1.10 etc ! its displays # then thats what set if your getting weird chars then thats a different issule!
  19. how is this even a decoding issule! you haven't shown anything to do with encoding except charsets! Edit: as a side note use THE EDIT button
  20. Sorry PC started to reboot so hit post try here $theText = "here is some [ code]sample data[ /code] is this ok";//<--remove spaces $result = preg_replace('~\\[code\\](.*)\\[\\\/code\\]~sim', "highlight_string('$1')", $theText); echo $result;
  21. $match = array( "/\]\n/", '#\[code\](.*)\[/code\]#se', '/\\\\"/'); Matches replaces of course "Grabs everything here" is formatted with <font color="#0000BB"></font> using the highlight_string can you post some example text..
  22. preg_replace it probley the easiest, i'll suggest doing a search their's few members who have done the same thing and their badword filters and BBcodes are all posted!!, Oh and your need to post some code for "real" help, or we're all just guess until the cows come home
  23. sessions (aka server side cookies)
  24. Secure + Cookie = mismatch, cookies are not secure
  25. OK heres a basic untested and incomplete example <?php $result= mysql_query($query); while ($row=mysql_fetch_array($result)) { $user = $row['user']; //<---get the idea $email_to = "XXXXXXX@XXXX.com"; //<--See above for example $email_from = "XXXXX server do not reply"; $email_title = "Total Clicks report"; $email_body ="Dear $user, Thank you, XXXXXX Site"; $success = mail($email_to,$email_from,$email_title,$email_body, "From:$email_from\r\nReply-To:XXXXXX server do not reply"); } ?> as a note you may need to clean up the code as your not pulling the fields you need from the database (see your select statement)
×
×
  • 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.