Jump to content

Rheanna

New Members
  • Posts

    7
  • Joined

  • Last visited

Rheanna's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. That removes all instances of the images as well as the number though...
  2. I'm very new to php. With help I was able to make this code work: <?php //get_additional is a custom funcion ob_start(); echo get_additional($tcgname,'Trades'); echo nl2br("\n"); echo '<div class="tboxout" style="background: url('.$tcgimg.')">'; echo '<div class="tboxin">'; $buffered = ob_get_clean(); echo $buffered; $times = $buffered; $imgurl = 'myimage.png'; for($i=0;$i<$times;$i++){ echo '<img src="'.$imgurl.'" />'; } echo '</div>'; echo '</div>'; ?> It pulls an image and displays it x amount of times depending on the integer that this part of the code outputs: echo get_additional($tcgname,'Trades'); My question is, how would I go about gathering that integer without actually displaying the information? I don't see how I would use a variable in this situation...
  3. I finally figured out what I was doing wrong!! It was super simple and totally not worth stressing over: All I had to do was change this: echo '<div class="tboxout" style="background: url('$tcgimg')">'; to this: echo '<div class="tboxout" style="background: url('.$tcgimg.')">';
  4. I need it to be a variable, because the background image can change based on the page it is on.
  5. <?php //get_additional is a custom funcion ob_start(); echo get_additional($tcgname,'Trades'); echo nl2br("\n"); echo '<div class="tboxout" style="background: url('$tcgimg')">'; echo '<div class="tboxin">'; $buffered = ob_get_clean(); echo $buffered; $times = $buffered; $imgurl = 'http://rheanna.magical-me.net/cosmos/cosmoscards/check.png'; for($i=0;$i<$times;$i++){ echo '<img src="'.$imgurl.'" />'; } echo '</div>'; echo '</div>'; ?> I fixed what I found wrong with it, the style tags in the div, but it's still pulling an error because of this line: echo '<div class="tboxout" style="background: url('$tcgimg')">'; The whole purpose of this code is to take an image and repeat it based on the number pulled by echo get_additional($tcgname,'Trades'); The problem I'm having is posting a background image to the div that encases the repeating image div. Does that make sense?
  6. I have this code: <?php //get_additional is a custom funcion ob_start(); echo get_additional($tcgname,'Trades'); echo nl2br("\n"); echo '<div class="tboxout" background='$tcgimg'>'; echo '<div class="tboxin">'; $buffered = ob_get_clean(); echo $buffered; $times = $buffered; $imgurl = 'myimage.png'; for($i=0;$i<$times;$i++){ echo '<img src="'.$imgurl.'" />'; } echo '</div>'; echo '</div>'; ?> and I reference it on a separate page, with this code: <?php $tcgname = "Cosmos"; $tcgimg = "wantedbackgroundimage.png"; ?> <?php include("/stamps.php"); ?> // this is the name of the first file For some reason the background image is not showing up at all and I can't figure out why. Can anybody explain to me why this isn't working?
×
×
  • 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.