Jump to content

almightyegg

Members
  • Posts

    791
  • Joined

  • Last visited

Everything posted by almightyegg

  1. I have lots of variables. The way I get the right one is like: $p$xd$y. Eg. if $x = 1 and $y = 4 it's $p1d4. I have got it to the point where I can get it to p1d4. But that's in another variable "$n = p1d4;" I want to put into an if{ }else{ } if($p1d4 == .. ){ but I can't work out a way to get it in the first place... If anypone can shed some light onto this it'd be great
  2. Right, I've solved that problem thanks for the help guys. Now I have another problem. There are variables like: $p1d1 = blah; $p2d1 = blah; $p3d1 = blah; etc.. $p1d2 = blah; $p2d2 = blah; $p3d2 = blah; etc.. $p1d3 = blah; $p2d3 = blah; $p3d3 = blah; etc.. The first number in each is represented by $x and the second by $y. So when I call the variable I am calling $p$xd$y - of course that doesn't work. What can I do to make it show, in this case, $p1d1???
  3. That wasn't the problem but I have found the problem. It's not carrying $x and $y through to each page (hense why it aways stays at -1 or 1). Is there a way I can do this simply?
  4. I was writing this script and I thought I'd test just this first bit and it isn't working... if(!$move){ $x = 1; $y = 1; echo "Current Position: $x,$y<br />"; echo "<center><a href='pit.php?move=n'>[North]</a><br> <a href='pit.php?move=w'>[West]</a> <a href='pit.php?move=e'>[East]</a><br> <a href='pit.php?move=s'>[south]</a></center>"; }elseif($move == s){ $y = $y+1; echo "Current Position: $x,$y<br />"; echo "<center><a href='pit.php?move=n'>[North]</a><br> <a href='pit.php?move=w'>[West]</a> <a href='pit.php?move=e'>[East]</a><br> <a href='pit.php?move=s'>[south]</a></center>"; }elseif($move == n){ $y = $y-1; echo "Current Position: $x,$y<br />"; echo "<center><a href='pit.php?move=n'>[North]</a><br> <a href='pit.php?move=w'>[West]</a> <a href='pit.php?move=e'>[East]</a><br> <a href='pit.php?move=s'>[south]</a></center>"; }elseif($move == e){ $x = $x+1; echo "Current Position: $x,$y<br />"; echo "<center><a href='pit.php?move=n'>[North]</a><br> <a href='pit.php?move=w'>[West]</a> <a href='pit.php?move=e'>[East]</a><br> <a href='pit.php?move=s'>[south]</a></center>"; }elseif($move == w){ $x = $x-1; echo "Current Position: $x,$y<br />"; echo "<center><a href='pit.php?move=n'>[North]</a><br> <a href='pit.php?move=w'>[West]</a> <a href='pit.php?move=e'>[East]</a><br> <a href='pit.php?move=s'>[south]</a></center>"; } It isn't finding $x and $y properly. If it $move = e or w then it says "Current Position: ,1" and if it is n or s it says "Current Position: 1," and that 1 never changes...never goes up or down...no matter how many pages it goes... Any idea?
  5. I wasn't sure how to check whether checkboxes had been checked, so I did this: $pinned = $_POST['pinned']; $locked = $_POST['locked']; if(!$pinned){ $pinned = No; }elseif(!$locked){ $locked = No; }elseif(isset($locked)){ $locked = Yes; }elseif(isset($pinned)){ $pinned = Yes; } $locked and $pinned are checkboxes from a form on the previous page. It sets to No when the boxes aren't checked but when they are checked it stays at "on" and even when I tried: if($locked == on){ etc.. it still had no affect Any help would be greatly received.
  6. What the ?? I just went to check and it doesn't even have 101 lines.... then I refreshed the web page and the error had gone ??
  7. I can't see what the problem with this is? Parse error: syntax error, unexpected '}' in /home/lordofth/public_html/editlinks.php on line 101 if(!$setlink && !$set && !$delete && !$cancel){ ?> <b>Custom Links:</b><br> <? if(!$mem[link1]){ echo "<a href='editlinks.php?setlink=1'>Set Link 1</a><br>"; }else{ echo "<a href='$mem[link1]'>$mem[linkn1]</a> [<a href='editlinks.php?setlink=1'>Relink</a>] [<a href='/editlinks.php?delete=1'>Delete</a>]<br>"; } if(!$mem[link2]){ echo "<a href='editlinks.php?setlink=2'>Set Link 2</a><br>"; }else{ echo "<a href='$mem[link2]'>$mem[linkn2]</a> [<a href='editlinks.php?setlink=2'>Relink</a>] [<a href='/editlinks.php?delete=2'>Delete</a>]<br>"; } if(!$mem[link3]){ echo "<a href='editlinks.php?setlink=3'>Set Link 3</a><br>"; }else{ echo "<a href='$mem[link3]'>$mem[linkn3]</a> [<a href='editlinks.php?setlink=3'>Relink</a>] [<a href='/editlinks.php?delete=3'>Delete</a>]<br>"; } if(!$mem[link4]){ echo "<a href='editlinks.php?setlink=4'>Set Link 4</a><br>"; }else{ echo "<a href='$mem[link4]'>$mem[linkn4]</a> [<a href='editlinks.php?setlink=4'>Relink</a>] [<a href='/editlinks.php?delete=4'>Delete</a>]<br>"; } if(!$mem[link5]){ echo "<a href='editlinks.php?setlink=5'>Set Link 5</a><br>"; }else{ echo "<a href='$mem[link5]'>$mem[linkn5]</a> [<a href='editlinks.php?setlink=5'>Relink</a>] [<a href='/editlinks.php?delete=5'>Delete</a>]<br>"; } }elseif(is_numeric($setlink) == TRUE){ $update = mysql_query("UPDATE users SET qlupdate='$setlink' WHERE id='{$mem['id']}'"); echo "Direct to the page you wish to link in and confirm it on the right panel under the other links."; }elseif($set == yes){ $link = $_POST['link']; $linkn = $_POST['linkn']; if(!$link){ echo "You haven't selected a link!"; }else{ $l = "link$mem[qlupdate]"; $n = "linkn$mem[qlupdate]"; $update = mysql_query("UPDATE users SET $l='$link',$n='$linkn',qlupdate='No' WHERE id='{$mem['id']}'"); echo "Your custom link was updated."; } }elseif(is_numeric($delete) == TRUE){ $update = mysql_query("UPDATE users SET link$delete='',linkn$delete='' WHERE id='{$mem['id']}'"); echo "You removed custom link number $delete."; }elseif($cancel = yes){ $update = mysql_query("UPDATE users SET qlupdate='No' WHERE id='{$mem['id']}'"); echo "You cancelled the updating process."; } ?> I can't spot why it might be unexpected... any help would be greatly appreciated
  8. They become all pixelated though... I'm going to scrap this idea anyway because there's a few issues with it which won't work with my ideas :-( Thanks for the help guys
  9. Thanks Bronzemonkey, is there anyway I could make it show up in a specific <td> section??
  10. Yes, I am going to paginate it so only 10-20 thumbs and large images are loaded. Unless you can suggest another way to do it that does it dynamically so you don't have to click every image and wait for each page to load???
  11. I got a script from DynamicDrive.com and it works fine. I'm just wondering if it be possible to adapt it slightly. (Not asking you to write anything for me just need a few pointers) It's this script: http://www.dynamicdrive.com/style/csslibrary/item/css-popup-image-viewer/ Basically I want the image to pop up in the exact same place on the page no matter what picture you hover upon. I think it should be something to do with position-absolute?? Thanks in advance
  12. Yes it does, but it still means I have to open 200+ files to do it
  13. No I'm using Notepad - is there no way to do it with pure PHP?
  14. On my files I always used to use sessions but then changed to COOKIES. All of a sudden where ever I have left a session_start it shows an error which it hadn't previously done... Anyways! Rather than going through each of the 100s of files 1 by 1 I was wondering if it's possible to write a script that deletes Session_start from any file that is in my directory?? Thanks in advance
  15. Ah it was an error on my part, I'd put an entire Array into $i1-5 intead it is $i1-5[name] All done
  16. I changed a few bits, it displays: Lord of the Abyss gave Array to Rulers of the Abyss. it says array instead of a list function filter_blank($val) { return ($val != ''); } $vals = array("$i1","$i2","$i3","$i4","$i5"); // I think it may be to do with the way the Array is set up if(!$reason){ $text = '<a href=/player/view.php?id=' . $mem[id] . '>' . $mem[username] . '</a> gave ' . implode(', ',array_filter($vals, "filter_blank")) . ' to ' . $clutch[name] . '.'; }else{ $text = '<a href=/player/view.php?id=' . $mem[id] . '>' . $mem[username] . '</a> gave ' . implode(', ',array_filter($vals, "filter_blank")) . ' to ' . $clutch[name] . '. Reason: $reason'; }
  17. I tried Ken's way and got $mem[username] gave Arrayto $clutch[name]. Reason: $reason function filter_blank($val) { return ($val != ''); } $vals = array("$i1","$i2","$i3","$i4","$i5"); if(!$reason){ $text = '<a href=/player/view.php?id=$mem[id]>$mem[username]</a> gave ' . implode(', ',array_filter($vals, "filter_blank")) . 'to $clutch[name].'; }else{ $text = '<a href=/player/view.php?id=$mem[id]>$mem[username]</a> gave ' . implode(', ',array_filter($vals, "filter_blank")) . 'to $clutch[name]. Reason: $reason'; }
  18. Thanks for the input but I'd rather just get this working other wise I'll just have to start over with another code. I made a few alterations myself, it now shows: Lord of the Abyss gave Array, to Rulers of the Abyss. Reason: Yeha $list = array("$i1","$i2","$i3","$i4","$i5"); $text = "<a href='/player/view.php?id=" . $mem['id'] . "'>" . $mem['username'] . "</a> gave "; foreach ($list as $value) { if (trim($value) != "") { $text .= $value . ", "; } } $text = trim($text,","); if(!$reason){ $text .= "to " . $clutch['name'] . "."; }else{ $text .= "to " . $clutch['name'] . ". Reason: $reason"; }
  19. Now it did this: Lord of the Abyss gave Array, Lord of the Abyss gave Array, to Rulers of the Abyss. Reason: Yeha
  20. No, it says 'Array, ' instead of he list
  21. It worked when I tested it outside of my code now when I inserted it within the rest of my own it has $text: 24-12-2007 17:57:31 Lord of the Abyss gave Array, to Rulers of the Abyss. $list = array("$i1","$i2","$i3","$i4","$i5"); $text = "<a href='/player/view.php?id=$mem[id]'>$mem[username]</a> gave "; foreach ($list as $value) { if (trim($value) != "") { $text .= $value . ", "; } } $text = trim($text,","); if(!$reason){ $text = "" . $text . "to $clutch[name]."; }else{ $text = "" . $text . "to $clutch[name]. Reason: $reason"; }
  22. I tried running the script Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/lordofth/public_html/society/bob.php on line 8 Line 8: $text .= $value " ,";
  23. Yeah, I'm stuck...again... basically I want to write a list like You gave $item1, $item2, $item3, $item4, $item5 to such and such... But The variables aren't always full, so the the list could be: You gave $item2, $item4, $item5 to such and such... OR You gave $item1, $item5 to such and such... How would I do smething like this?? Any ideas greatly received
×
×
  • 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.