Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. oh yeah if the ref's are single words (no spaces) this should work <?php $string = 'text [ref]1[/ref] middle [ref]2[/ref] end'; $pattern[] = '/\[ref\](\w*)\[\/ref\]/'; $replacement[] = '<sup><a href="#ref${1}">[${1}]</a></sup>'; echo preg_replace($pattern, $replacement, $string); ?>
  2. if its just numbers then you could use <?php $string = 'text [ref]1[/ref] middle [ref]2[/ref] end'; $pattern[] = '/\[ref\]([\d]*)\[/ref\]/'; $replacement[] = '<sup><a href="#ref${1}">[${1}]</a></sup>'; echo preg_replace($pattern, $replacement, $string); ?>
  3. try <?php mysql_connect("localhost", "root","2233home") or die(mysql_error()); mysql_select_db("task_logging") or die(mysql_error()); $query="UPDATE in_progress SET steps_taken = CONCAT(steps_taken,'$_Actions') where ID = '$_ID'"; $result=mysql_query($query) or die ("Error in the query" .mysql_error()); mysql_close(); ?>
  4. Woohoo I Rule LOL I mean cool
  5. i think change color: <?php print $background_colour;?>; to background-color: <?php print $background_colour;?>; for the background i think color:<?php print $text_colour;?>; for the text colour thats more of a CSS issule!
  6. file name style.css should be style.css.php
  7. First off, Thank you for replying (was lossing hope) OK basically i have a class thats getting quite large, and i don't know if the way i am doing it affects performance, taking into account that i don't need two thirds of the classes half the time, the problem with adding them all into one class is that it would get very messy (more then now) each class uses its own variables and private methods where function names would conflict. i guess if i could include the class with "these" extended classes or some how append a class to it after its been included.. that might be a way but again would this affect performance ! kinda at a loss end if you know what i mean!
  8. update the password in the database with the MD5 function
  9. Quick Note change the Password('$password') to MD5('$password') also update the password in the same manner.. ok thats mi last thoughts.. night
  10. and its not going well ... take the advice...
  11. last bump... ~Sighs~ will check when i get up.. i dream of a solution or an idea
  12. use nl2br() if your displaying to the page then html is kinda involved!
  13. i do.. #1 remove the "and password = password('$password')" #2 if #1 works check the entry in the database (try updating it) if not check the username i am signing out at it 4am and i need sleep good luck
  14. most welcome, but please click solved lol Beat me to it
  15. <?php $row = mysql_fetch_array($result,MYSQL_NUM) or die(mysql_error()); print_r($row); // <--Add back inn die; // <--Add return (mysql_num_rows($result)>0); // <--Add this ?>
  16. ahh ok try <?php $len = 25; $data = "fhjsad dhjas dhasjkdh ashdjkas dhjas dhaskjd ashdj hasjkd hsakjd hsajdhsakjd hsakjd hsaj hjk"; echo (strlen($data) > $len ? substr($data, 0, $len)."..." : $data); ?>
  17. OK almost done change <?php $row = mysql_fetch_array($result,MYSQL_NUM) or die(mysql_error()); //print_r($row); return (mysql_num_rows($result)>0); // <--Add this ?>
  18. whats the goal ? end result? as i still don't know what your trying do to !
  19. Woohoo OK change <?php $result = mysql_query("select * from members_info", $id) or ?> to <?php $result = mysql_query("select * from members_info where user_name='$user_name' and password = password('$password')", $id) or ?> retest
  20. <?php $data = "fhjsad dhjas dhasjkdh ashdjkas dhjas dhaskjd ashdj hasjkd hsakjd hsajdhsakjd hsakjd hsaj hjk"; echo substr($data, 0, 25)."..."; ?>
  21. ok from the top now of course add the USER, PASS, HOST & DATABASE <?php function login($user_name, $password) // check username and password with db // if yes, return true // else return false { // connect to db // $conn = db_connect(); $id = @mysql_pconnect("HOST", "USER", "PASS") or MySQL_ErrorMsg("Unable to connect to MySQL server"); @mysql_select_db("DATABASE", $id) or MySQL_ErrorMsg ("Unable to select database"); // check if username is unique $result = mysql_query("select * from members_info", $id) or MySQL_ErrorMsg ("Unable to perform query: $query"); $row = mysql_fetch_array($result,MYSQL_NUM) or die(mysql_error()); print_r($row); } ?>
  22. theirs lots you can do to "improve" BBcode, image support, Bots etc the list goes on LOL
  23. ??? erm you should get array() atleast! comment out the <?php // if (!$conn) // return 0; ?>
  24. i'm not sure if that was the question if it was use nl2br() on the data return'd from the database its quicker
×
×
  • 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.