Jump to content

drdysdy

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

drdysdy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Well what I'm trying to do is set what image should be displayed. I have a 9x9 table filled with images: I'm trying to create a 2d map, each image will be a tile in the map. The center tile is controlled by the user, and each other tile is set depending on where the user is. If there is an object at that coordinate, it will display an image, otherwise it will display the default image (blank.jpg) I'm not sure how I could use an array to do this.
  2. I'm trying to create a variable called $row1line1, but I need to do it dynamically because I also want to create more variables like $row1line2. So I need to use variables as the name of another variable. Sorry, I fail at explaining right now, it's a little late.
  3. So what I'm trying to do is combine multiple variables to create the name of one variable. A friend of mine explained to me how to do it years ago, but I don't really remember how it was done. He did it something like this: <? $rownum = "1"; $linenum = "1"; $row.$$rownum.$line.$$linenum = "blank.jpg"; ?> <<? echo "img src=$row1line1"; ?> alt="" name="Row1Line1" width="50" height="50" id="Row1Line1" /> I'm not sure what it is, but I'm doing something wrong.
  4. [!--quoteo(post=369348:date=Apr 27 2006, 03:32 PM:name=Webnerdz)--][div class=\'quotetop\']QUOTE(Webnerdz @ Apr 27 2006, 03:32 PM) [snapback]369348[/snapback][/div][div class=\'quotemain\'][!--quotec--] I know the answer is probably right in front of me, but I just cannot figure it out. Can anyone please help me with the syntax here: if ($i==1){$filename='$crpage';} $crpage is the variable called from the previous page. When it creates the file it creates a file called $crpage.html in the directory. I just need to figure out why it doesn't create the name that is entered in the form for the $crpage variable. Thank you all in advance for any assistance you can provide! [/quote] Umm, I'm not sure if I understand what you mean but here [code]if ($i==1){$filename="'$crpage'.html" }[/code] Try that
  5. [!--quoteo(post=367205:date=Apr 21 2006, 09:55 AM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Apr 21 2006, 09:55 AM) [snapback]367205[/snapback][/div][div class=\'quotemain\'][!--quotec--] In the following code your cookie wont be set as your are outputting html to the browser and so PHP cannot set the cookie. You cannot sent anytrhing to the browser before the use of setcookie.[code]<html> <title>Set ship cookie</title> <body> <?php include "dbinfo.inc.php"; if (isset($_POST['submit'])){ $objid = $_POST['objid']; setcookie( 'objid', $objid, time()+60*60*24*30, '/', '*edited*'); echo "<br>$objid"; }else{ echo "The post didn't come through"; } ?> </body> </html>[/code] [/quote] Yea i cought that, but still it doesn't work. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] the second bit of code should be telling you success or failure -- do you get any output at all? [/quote] its outputting 'failure' [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] Also, you're checking for $_POST['submit'] but you're assigning $_POST['objid'] without testing for it. You might want to include a print_r($_POST); to make sure all of your expected variables actually exist. [/quote] Thats what the echo "<br>$objid"; is for =P
  6. Ok, I've been trying for the last 12 hours to get this damn script to set one damned cookie! LOL. But I can't figure it out so I'm asking you people for help! [code]<html> <title>Set ship cookie</title> <body> <?php include "dbinfo.inc.php"; if (isset($_POST['submit'])){ $objid = $_POST['objid']; setcookie( 'objid', $objid, time()+60*60*24*30, '/', '*edited*'); echo "<br>$objid"; }else{ echo "The post didn't come through"; } ?> </body> </html>[/code] Ok, and before you ask dbinfo does not output anything. Help would be appreciated Also [code]<?php include "dbinfo.inc.php"; if (isset($_POST['submit'])){ $objid = $_POST['objid']; $success = setcookie( 'objid', $objid); if($success){ echo "succeeded"; }elseif(!$success){ echo "failed"; }else{ echo"hmm"; } setcookie( 'objid', $objid, time()+60*60*24*30, '/', '*edited*'); echo "$objid"; }else{ echo "The post didn't come through"; } ?>[/code] This doesn't work either (Forgot not to output anything to the browser before setting the cookie)
×
×
  • 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.