Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
New php-forum User
New php-forum User
Posts: 34
Joined: Thu Dec 12, 2002 9:00 pm
Location: NJ

Wed Feb 26, 2003 8:38 am

Ok i created a function called smiles.. and inside the function it has 2 arrays here is the code...

Code: Select all

function phpblock_getsmiles($smiles)
   $face = array(":D", ":)");
   $img = array (
             "<img align=absmiddle src='images/smilies/biggrin.gif' alt='Big Grin'>",
          "<img align=absmiddle src='images/smilies/smile.gif' alt='Smile'>" );
      $smiles = str_replace( $face, $img, $smiles );
      return $smiles;    

now my problem is that the images are no showing up in the forum post..

this is what i have for my other script...

(btw this is a memo script)

Code: Select all

//Once Submited insert in to db

 $memo = phpblock_getsmiles($_POST['memo']);
 $memo = $_POST['memo'];
 $sender = $_USER['username'];
 $date = date("D dS M,Y");
 $time = time("h:i a");
 $sql = "INSERT INTO gl_memo(id, sender, username, memo, date) VALUES ('$id','$sender', '$username',
         '$memo', '$date')";
 $result = mysql_query($sql) or die(mysql_error());
 echo '<CENTER><FONT face=\"verdana\"><br><Br> Memo has been sent  ' . $username;
  echo '<meta http-equiv="refresh" content="1;url=">';
// Now lets show the form
        <TABLE WIDTH="75%" align=center border=0><TR ><TD >

      <FORM METHOD="post" ACTION="<?php $PHP_SELF ?>">
       From: &<b> <?php echo $_USER['username']; ?>
      <td>Send Memo to :&
       <INPUT TYPE="text" NAME="username" VALUE="<?php echo $_GET['to']; ?>"><?php $username ?></td></tr>
      Messege: <br></td></tr>
      <tr wrap><td colsspan="2" wrap>
       <TEXTAREA ROWS="10" COLS="65"  NAME="memo"  wrap=physical VALUE="<?php $_POST['memo']; ?>"></TEXTAREA></td></tr><br><tr><br><td div align="left">
      <INPUT TYPE="submit" NAME="submit" ALT="submit" value="submit">
echo COM_sitefooter(true);

now this has noting to do with the db cause the smiles are not in the db.. but.. how do i make it show in a post? once submited i want it to replace ' :) ' with its image
but i cant seem to get it to work =(
:D <---- like that
Computer/Programm rox.. (php, c/c++ will take over soon muhahah

New php-forum User
New php-forum User
Posts: 67
Joined: Mon Feb 24, 2003 2:55 am
Location: ../Ukraine/Kherson

Thu Feb 27, 2003 1:00 am

Save in your base link to your icons
PHP+MySql= Love :)

Post Reply