Jump to content

droopz17

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

droopz17's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. K I tried your idea and i thought it was going to work great but unfortunately it did not work... at least not yet. Below is the code that i have and the result it gives me. And yes! I already tried eval() to try and get the code to execute as php code instead of it treating it as a string but it still doesn't work. Please help!!! $get_profile_comments_q = mysql_query( $get_profile_comments ); $get_profile_comments_nr = mysql_num_rows( $get_profile_comments_q ); if( $get_profile_comments_nr > 0 ){ while( $get_profile_comments_a = mysql_fetch_array( $get_profile_comments_q ) ){ $comment = $get_profile_comments_a['pro_com_comment']; $img = str_replace( " [ img ]", "<?php include('image_handler.php?image= ", $comment ); $img = str_replace( "[ /img ]", " '); ?>", $img ); //echo eval("?>".$img); //tried this like a ton of different ways. echo ' <tr> <td> <table width="100%" border="0" cellspacing="2" cellpadding="5" class="maintext3"> <tr> <td align="center" width="125">'.$get_profile_comments_a['user'].'</td> <td width="575">'.$get_profile_comments_a['pro_com_date'].'</td> </tr> <tr> <td align="center" valign="top"><img src="'.$get_profile_comments_a['picture'].'" border="0" class="photo"></td> <td>'.$img.'</td> </tr> </table> </td> </tr>'; } } and blow is what i get if i view the page source. <td><?php include('image_handler.php?image= www.onflex.org/images/iceberg.jpg '); ?></td> as you can see it's just printing out the php line instead of executing it.
  2. Thanks for the great idea! i'll try it and see what i come up with.
  3. I want to have all images hotlinked to be resized if they are bigger than ( let's say 500 ) so that it won't distort my layout. Now here's the tricky part. It's basically a comment and I have it set up where they put [ img ] url [ / img ] of course without the spaces. Here what i want. I want it to go through the whole comment and take the image tag and determine the size and if it's bigger than my chosen size then add a width size to the img src tag. but i want it so they can hotlink as many images as they would like. exp below. pretend images: http://whatever.jpg ( lets say size is 600 ) http://whatever2.jpg (lets say size is 400 ) pretend comment below:------------------------------------------ hey man check out this image i found [ img ] http://whatever.jpg [/ img ] oh and this one too! [ img ] http://whatever2.jpg [ / img ] k man hit me back ------------------------------------------------------------------ and i want it to show the comment and images all at the same time and if they had to be resized then the script took care of it. I've tried everything i can think of.... Please help!!!
  4. Sweet thanks
  5. My site involves a header ( nav goes between header and middle ) middle ( main content goes between middle and footer ) and footer. exp: include('header.php') include('nav.php') include('middle.php') main content.php include('footer.php') well i want to have it so that when someone fills out a form wrong it submits an error message and displays it at the top of the main content using middle.php but i'll have the footer.php collect all the error messages which are being assigned to "$em.= 'my errors';" using a hidden field and using header to redirect back to the same page. If i have footer echo the em then the problem is that it shows all my content and then the error message at the bottom. So i was thinking i could have it take the $em variable and redirect to the same page using a hidden field so that it can be displayed in the middle.php which will show the errors messages on the top of all my content. here's how it goes header nav middle if error message then redirect along with hidden variable ($em) and diplay using middle else display form footer. so if you can see i have it displaying the form or the error and i think i just thought of how to fix it but i'm gonna leave this up still. I could do it as " echo 'my error message'; but i want it to be setup so that all my message look exactly the same and all i have to do is change the error message display in the middle.php if i want to change the format at all.
  6. php 5, just talked to my hosting about looking into it, but i'm just gonna put it in my files directly and be done with it, thanks to everyone that tried helping but this one is done.
  7. It's all because of a bug!!! read this crap right here. http://bugs.php.net/bug.php?id=26032
  8. In my fuction i'm using return $out_var, Is it the return that is messing it up??? if so would using globals help?
  9. My code is inside my <?php ?>, php lines. I have a site with like over a 100pages all going off a template, basically a header and footer that is included in each page i code. I have one page that request it but request the encode() fuctions like 5 times. but is only included once.
  10. Fatal error: Cannot redeclare encode() (previously declared in include/encoder.inc:2) in include/encoder.php on line 2
  11. I thought that might help, but either way it still give the fatal error, is there a way to exit from the include once you use it. kinda like when you use mysql you can close it with mysql_close
  12. include_once("include/encoder.inc"); $ad_encode = encode('admin_rights'); <?php function encode($var){ $out_var = ''; $s = '0'; $e = '1'; $num_char = strlen($var); //WHILE NUMBER OF CHARACTERS IS LESS THE THE NUMBER OF I while( $i < $num_char ){ $new_var = substr($var, $s, $e ); //long if statement goes here. $s++; $i++; } return $out_var; } function decode($var){ $out_var = ''; $s = '0'; $e = '2'; $num_char = strlen($var); //WHILE NUMBER OF CHARACTERS IS LESS THE THE NUMBER OF I while( $i < $num_char ){ $new_var = substr($var, $s, $e ); //long if statement goes here. $s++; $s++; $i++; $i++; } return $out_var; } ?>
  13. No it still is not working, please someone help me. I want my functions in a seperate file so i have it organized. I do not want to resort to putting it in my pages.
  14. .php, man i bet your right let me try it and see.
  15. include_once("includes/functions.php"); $test = encode('whatever'); The actual code is to encode my cookies so i rather not include it. I just need to know why any time i make a function in a seperate file then include it, if i use it more than once in my site it gives me a fatal error.
×
×
  • 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.