Jump to content

Shadow Hatake

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Shadow Hatake's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. okay I tried that and it add's yen signs where the breaks should be... http://www.infected-designs.com/chatbox/chatbox.php
  2. Oh okay. So how would I do this with an image?
  3. Alright I tried that and it didn't work so I decided to try a test. [code]<?php $test = "this is a test string"; $test2 = wordwrap( $test, 4 ); echo $test2; ?>[/code] and it won't wrap. http://www.infected-designs.com/chatbox/test.php
  4. Olay, so I'm making a chat box in an iamge and I want the line to stop at a certain point and make a new line. How would I do this? Here's my code. It's currently untested due to my hosting being down. [code]<?php include('dbconnect.php'); $height = 150; $width = 400; $background = 'http://www.infected-designs.com/chatbox/chatbox.png'; $im = imagecreatefrompng($background); $white = imagecolorallocate( $im, 255, 255, 255 ); $x = 32; $query = "SELECT * FROM chatbox ORDER BY id ASC"; $result = mysql_query( $query ); while( $row = @mysql_fetch_array( $result, MYSQL_ASSOC ) ) { imagestring( $im, 2, 7, $x, $row['name'].': '.$row['message'], $white ); $x = $x + 15; } header('Content-Type: image/png'); imagepng($im); ?>[/code]
  5. Odd. Would it make a difference if I was using more letters? This is the whole code I'm using. [code] <?php $test = "a"; $letters = array( 'a',   'b',   'c',   'd',   'e',   'f',   'g',   'h',   'i',   'j',   'k',   'l',   'm',   'n',   'o',   'p',   'q',   'r',   's',   't',   'u',   'v',   'w',   'x',   'y',   'z');   $replace = array( 'b5fc',   'c8hd',       'd8re',       'ej9f',       'f8jg',       'g8ph',       'hd7i',       'iokj',       'ji8k',       'kh0l',       'lbhm',       'm87n',       'nuvo',       'ohvp',       'p7yq',       'qjhr',       'ribs',       'soit',       't9nu',       'ud6v',       'v89w',       'w9sx',       'x8sy',       'y9dz',       'z8ha',       'a9jb'); echo str_replace($letters, $replace, $test); ?>[/code] http://www.infected-designs.com/replace.php
  6. Daniel0: If you read my post I tried that. It sent it into an infinite loops. hackerkts: I'll try that.
  7. Okay I have a problem. I want to echo the results of a str_replace() but when I put echo infront of it it goes into a huge loop. Here's my code: [code]<?php $test = "a b"; $letters = array('a', 'b'); $replace = array('t455', '5gr4'); str_replace($letters, $replace, $test); ?>[/code] So how should I go about doing this?
  8. I recently started a programming job and started on a tutorial to learn from. In the tutorial it talked about how the program I would be making would have a few layers. Well I got the idea for doing that for my site with php. But I'm still not great with php. What i want to do is basically have a code layer where all my php code resides, and then the interface layer where the code is displayed. Does anyone have any links suggestions, or pieces of code I can learn from?
  9. How would go about doing this? I'm putting in 7 variables, but how would I make a loop where each variable was only used once and made every possible comination?
  10. I got bored and decided to code a random ad script. And this si what I've got... [code]<?php include('dbconnect.php'); $query_link = 'SELECT link FROM ads'; $result_link = mysql_query( $query_link ); $row_link = @mysql_fetch_array( $result_link, MYSQL_ASSOC ); shuffle( $row_link ); echo '<a href="'.$row_link.'">'; $query_img = 'SELECT img FROM ads WHERE link = "'.$row_link.'"'; $result_img = mysql_query( $query_img ); $row_img = @mysql_fetch_array( $result_img, MYSQL_ASSOC ); echo'<img src="'.$row_img.'"></a>'; ?>[/code] Now when I go to test it it doesn't work. Help?
  11. [code] <?php include('dbconnect.php'); $id = $_GET['jid']; $question = $_GET['q']; if( isset( $_GET['jid'] ) ) {      if( isset( $_GET['q'] ) ) {          $query = 'SELECT '.$question.' FROM boards WHERE id = "'.$id.'"';         $result = mysql_query( $query );                              if( $result ) {             echo $result;         } else {             echo 'Error';         }     } else {         echo 'Page accessed incorrectly...';     } } else {     echo 'Page accessed incorrectly...'; } ?>[/code] All I'm getting is resource id #3 when it should be showing the query. Help?
  12. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''boardname' , 'retrievalname' , 'cat1_name' , 'cat1_q1' , 'cat1_a1' , 'cat1_q2' ' at line 1[/quote]
×
×
  • 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.