-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
Yes, thats what i mean, make sure its the correct user account see here,
-
Humm probably one large one.. as it will be shorter as the include "file1.php"; wasn't added anyways yeah what Crayon Violent said
-
same rules should apply, infact doesn't IIS have user and group controls (no idea is they affect tomcat) either way.. changing the user that the service uses or changing the rights of that user should resolve the issule.
-
ooops, remove the \b (shouldn't be thier) if (preg_match('%(.*\[/quote\])(.*)$%si', $text, $regs)) { $Var1 = $regs[1]; $Var2 = $regs[2]; }else{ //No quotes found }
-
or just change the windows permissions to everyone
-
ftp_chmod works fine on a windows server running filezilla server! If you apache needs to follow these permissions then your need to use a program execution function, and probably change the user that the apache service uses, may i ask what your trying to do ?
-
[SOLVED] Multi submit buttons on a single form!
MadTechie replied to Stefan's topic in PHP Coding Help
Yes..unless your creating an array, but then you need to append [], simply put yes. or only the last value will be used.. or to put it in php logic $var = "test"; //was their any point setting this? $var = "test2"; echo $var; //test2 but if you mean can you use the same elements for different functions, then thats fine! -
Erm.. ftp_chmod is not chmod its ftp_chmod they are not the same ftp_chmod runs vai the ftp protocal, which is the same as which is the command you asked for
-
Okay little different style but again may work (can't test here) <?php $text = '[ quote] [ quote] test [/quote] why are you testing[/quote] because i want to!'; if (preg_match('%(.*\b\[/quote\])(.*)%si', $text, $regs)) { { $Var1 = $regs[1]; // "[ quote] [ quote] test [/quote] why are you testing[/quote]" $Var2 = $regs[2]; // " because i want to!" } ?>
-
Theirs a few but changing permission via the FTP protocal is the best probably the option, you could use a "Program execution Functions" and set them via a command line..
-
This is HTML based but, FYI: i think this is handled by the browsers so you can't change it..
-
Try this (i'm at work so can't test it but looks ok) <?php $text = '[24]Test[25]Thank you for reading![/quote] Response 14455.'; if (preg_match('%^(.*?\[\/QUOTE\])(.*)$%si', $text, $regs)) { { $Var1 = $regs[1]; // "[24]Test[25]Thank you for reading![/quote]" $Var2 = $regs[2]; // " Response 14455." } ?>
-
Okay... And the problem is ? PS. your not using that function!
-
you may have a weird character in your code copy your code into notepad, then copy it from notepad and paste it back in, heres some working code <form method="POST"> <input type="text" name="editor1_content"> <input type="submit" name="submit"> </form> <?php if(isset($_POST['submit'])) { $variable= nl2br(htmlentities($_POST['editor1_content'])); echo $variable; } ?>
-
and its whats not showing right ? little more info would be nice
-
Erm.. missing the starting < of <?php maybe..!
-
i had a quick review and updated 3-4 parts <table width="100%" border="0"> <? require('inc/config.php'); include('inc/bbcode.php'); $linkid = @mysql_connect("$db_host", "$db_uname", "$db_pass"); mysql_select_db("$db_name", $linkid); //included are instructions on how to make multiple pages of news // If current page number, use it // if not, set one! if(!isset($_GET['newspage'])){ $newspage = 1; } else { $newspage = $_GET['newspage']; } // Define the number of results per page $max_results = 4; // Figure out the limit for the query based // on the current page number. $from = (($newspage * $max_results) - $max_results); // Perform MySQL query on only the current page number's results $sql = mysql_query("SELECT topic_id, topic_title, topic_poster, topic_type, topic_replies FROM phpbb_topics where topic_type=3 order by topic_id desc LIMIT $from, $max_results"); while($row = mysql_fetch_array($sql)){ //this wasn't closed (i closed it at the end) $sql2 = mysql_query("SELECT topic_id, post_id FROM phpbb_posts where topic_id=".$row['topic_id']); //updated $row2 = mysql_query($sql2) or die("$sql2 does not make any sence;<br>" . mysql_error()); $contentrow2 = mysql_fetch_array($row2); $sql3 = mysql_query("SELECT * FROM phpbb_posts_text where post_id=".$contentrow2['post_id']); //updated $row3 = mysql_query($sql3) or die("$sql3 does not make any sence;<br>" . mysql_error()); $contentrow3 = mysql_fetch_array($row3); // Build your formatted results here. echo '<tr><td><font size=3 color=#908F95><b>'.$row['topic_title'].'</b><br></td></tr></font> <tr><td><font size=2 color=908F95>'.nl2br($contentrow3['post_text']).'</font></td></tr> <tr><td><font size=2 color=#908F95><p align=right><br><br></p></font>'; // Figure out the total number of results in DB: $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM phpbb_topics"),0); // Figure out the total number of pages. Always round up using ceil() $total_pages = ceil($total_results / $max_results); // Build Page Number Hyperlinks echo "<center><font size=2>Select a Page<br /></font>"; // Build Previous Link if($newspage > 1){ $prev = ($newspage - 1); echo "<font size=2><a href=\"".$_SERVER['PHP_SELF']."?newspage=$prev\"><<Previous</a> </font>"; } for($i = 1; $i <= $total_pages; $i++){ if(($newspage) == $i){ echo "$i "; } else { echo "<font size=2><a href=\"".$_SERVER['PHP_SELF']."?newspage=$i\">$i</a> </font>"; } } // Build Next Link if($newspage < $total_pages){ $next = ($newspage + 1); echo "<font size=2><a href=\"".$_SERVER['PHP_SELF']."?newspage=$next\">Next>></a></font>"; } echo "</center>"; } ?> </table>
-
<?php $SETTINGS = Array ( $hostname_conn_abrv = "localhost"; //database hostname, usually always localhost $database_conn_abrv = "name"; //database name $username_conn_abrv = "user"; // database username $password_conn_abrv = "pass"; // database ); //whats the above doing!!! thats not valid! //move it out of the array! $conn_abrv = mysql_pconnect($hostname_conn_abrv, $username_conn_abrv, $password_conn_abrv) or trigger_error(mysql_error(),E_USER_ERROR); ?> Try this instead! <?php $SETTINGS = Array ( "hostname_conn_abrv" => "localhost", //database hostname, usually always localhost "database_conn_abrv" => "name", //database name "username_conn_abrv" => "user", // database username "password_conn_abrv" => "pass" // database ); $conn_abrv = mysql_pconnect($hostname_conn_abrv, $username_conn_abrv, $password_conn_abrv) or trigger_error(mysql_error(),E_USER_ERROR); ?> Or more likly <?php $hostname_conn_abrv = "localhost"; //database hostname, usually always localhost $database_conn_abrv = "name"; //database name $username_conn_abrv = "user"; // database username $password_conn_abrv = "pass"; // database $conn_abrv = mysql_pconnect($hostname_conn_abrv, $username_conn_abrv, $password_conn_abrv) or trigger_error(mysql_error(),E_USER_ERROR);
-
Spam problems on our comments form - Please help
MadTechie replied to tigra's topic in PHP Coding Help
And use email activation, they spam you ban, they get another email precess repeats.. worst case.. every post will say in a queue until an mod can verifiy it. registration with email activation, IP loggin and captcaha, word filtering, normally stops 95% (depending on the site) -
you can't really do it as one massive replace i would probably do something like this <?php $phrase = "abababDbbb"; $crypt = array( "a" => "b", "b" => "c", "c" => "a" ); $p = preg_split("//", $phrase); //cleanup unset($p[0]); unset($p[count($p)]); $newphrase = ""; foreach($p as $letter) { if(isset($crypt[$letter])) { $newphrase .= $crypt[$letter]; }else{ $newphrase .= $letter; } } echo $newphrase; ?>
-
And the problem is ?
-
[SOLVED] noob question function to go array a-z
MadTechie replied to ratcateme's topic in PHP Coding Help
Range() $var = range('a', 'z') -
Nope, they do the same thing just saves time when you have / in the patten
-
In RegEx you need to tag the start and end of the patten, after the last tag you can add switches Now i am using 2 switches S and I, (dot match new lines and case insensitive), the tag i normall use are / but this can be almost anything I used % because of the / used in /QUOTE I could of done this (escape the / in /quote) if (preg_match('/(.*?\[25\])([^]]*?\[\//QUOTE\])/si', $text, $regs)) { if i didn't escape the / then it would think i wanted the switches to be "QUOTE\])/si" instead of just "si" but i find it easier to use % then again i could use # or @ or : or ~ etc ie for # it would be if (preg_match('#(.*?\[25\])([^]]*?\[\/QUOTE\])#si', $text, $regs)) { hope that makes sense