-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
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");
-
[SOLVED] Breaking apart a long text article
MadTechie replied to londonjustin's topic in PHP Coding Help
whats wrong with using explode("\n", $article) ? -
welcome, please click solved
-
[SOLVED] Breaking apart a long text article
MadTechie replied to londonjustin's topic in PHP Coding Help
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>"; } ?> -
try this <?php $info = "<font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\"><strong>Name: </strong>".addslashes($name[1])."<br></font></a></font>"; ?> addslashes
-
$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");
-
[SOLVED] How do I search for a string broken up by new lines
MadTechie replied to BenPac's topic in PHP Coding Help
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']); } ?> -
my test was echo "~$c~" so if a newline appeared i would get ~ #~ easy mistake to make (been their got all the t-shirts)
-
use CURRENT_TIMESTAMP or NOW() ie mysql_query("UPDATE `php_blog` SET `timecode` = 'NOW()' WHERE `id`='1'");
-
erm.. worked for me <?php $text = "# hello world"; $text = explode(' ', $text); $c = current($text); if( $c == "#" ) { echo 'test'; } ?>
-
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
-
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
-
Its not a problem with the VERSION, please read the posts over again!
-
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
-
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,
-
Need Help with Simple Test: Header errror Warnings
MadTechie replied to chobo2's topic in PHP Coding Help
you sure the problem isn't in "simpletest/unit_tester.php" or "simpletest/reporter.php" -
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
-
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!
-
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
-
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;
-
$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..
-
sessions (aka server side cookies)
-
Secure + Cookie = mismatch, cookies are not secure
-
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)