Jump to content

Abbeh

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Everything posted by Abbeh

  1. Okay, I've recently started helping a company with minor PHP bug fixes after a server switch, and they've come to me with a problem about some images not showing up. To be honest, I haven't got a clue, and I'm not even sure if this is the right forum for the issue, but I was wondering if you guys could help me. The images don't have any extension, but loading the files individually into a browser, my FireFox tells me the dimensions and that they are JPEG images. The thing that is strange is that there are other files that are similar (no extension) that actually show up on the website. http://www.mahoganymodelmanagement.com/images/models/file2886 That is one of the files in question. Could this be down to file corruption, or is there something else we're not seeing? Thanks for reading, and apologies if this is in the wrong place!
  2. Okay, I have no idea how I'm going to attempt this, and this is the only thing I'm stuck on. I'm opening a horse game, which needs colours to go with a breed. Basically, I need something that will tell the function for breeding two horses that if the colour selected DOESN'T appear in the allowed colours, then it needs to select a new colour. Say you have Breed 1. Breed 1 can only have Colour 1 and Colour 2. The function selects Colour 3. So I need it to be able to reselect either Colour 1 or Colour 2. Any ideas? =\
  3. Ah, I see it now.. thanks a lot!
  4. Okay, I have a cron file which updates member accounts among other things overnight. For some reason, it's only expiring upgraded accounts one at a time, which poses a real problem if 6 accounts need to be expired - it takes 6 nights! Can anyone spot anything wrong with this coding? [i've checked that all the names match the table, and no MySQL errors appear] //REMOVE EXPIRED UPGRADES $result = mysql_query("SELECT mid FROM members WHERE daysleft<'1'") or die ('cannot remove upgrade and reset daysleft 2'); while ($row = mysql_fetch_array($result)) { $mid = $row['mid']; $result = mysql_query("SELECT sid FROM stables WHERE mid='$mid'") or die ('cannot get barn id'); $row = mysql_fetch_array($result); $stables = $row['sid']; mysql_query("UPDATE horses SET stable=1 WHERE stable='$stables'") or die ('cannot remove horses from deleted barn'); mysql_query("DELETE FROM stables WHERE mid='$mid'") or die ('cannot delete members barn for expired upgrade'); mysql_query("UPDATE members SET daysleft=365, type=1, horselimit=10, prefix='', avatar='', fullpage=0 WHERE mid='$mid'") or die ('cannot update member upgrade status'); } Does anyone have any ideas?
  5. I already have that for the basic members, but one of the account upgrading "perks" was to have a full-page layout but thanks for the suggestion!
  6. Okay, here's the story. I own a PHP/MySQL equine sim game which allows members, on their account pages (which other members can view) to insert their own HTML and create their own personal layout. However, some forget to end table tags, or some other HTML tags and it kinda messes around with the site's main layout. How can I combat this? Is there a code that can end tags, or am I just going to have to include tutorials Thanks for reading
  7. Ah, as I was gathering that information for you I noticed the problem - very sorry for wasting your time! I had the alerts.php included in my header.php as well as the page I was using Sorry!
  8. Hey there, I've been trying to code alerts for my virtual pet site, using mySQL queries to select data and PHP to display it. However, I've checked that I'm connected to the database and there is a member session, but I am getting this response: Fatal error: Cannot redeclare getalert() (previously declared in /home/pcp/public_html/alerts.php:2) in /home/pcp/public_html/alerts.php on line 17 but "getAlert()" is the only function in the whole "alerts.php" file - there's nothing else in there, no doubles of the same function. Here is the function: <?php function getAlert($mid) { $loop = mysql_query("SELECT id, message FROM alerts WHERE mid='$mid' ORDER BY id DESC") or die ('cannot select alerts'); while ($row = mysql_fetch_array($loop)) { $id = $row['id']; $message = $row['message']; echo "$message"; } if (!mysql_num_rows($loop)) echo "No Alerts!"; } ?> and then a simple echo getAlert($mid). Does anyone have any idea what's going on with this? I'm still learning PHP so I'm still spending ages trying to figure out kinks and errors, but this one I really can't figure out :-\
  9. Okay, I cut it down to the "Post Topic" and "Post Reply" parts which are where the problems are.
  10. The first few lines are includes, and then the header code for the layout, they're working fine. This is the start of message board posting and replies. EDITED: This should be all, I think. <?php if($msg_id){ if(@$_POST['post_reply']){ $subject = strip_tags(@$_POST['subject']); $body = nl2br(@$_POST['body']); $date = date(YmdHis); if(!$subject){echo "<tr><td colspan=2><center><font color=red>Invalid Subject!</td></tr>";} if(!$body){echo "<tr><td colspan=2><center><font color=red>You must include a message.</td></tr>";exit;} @mysql_query("INSERT INTO msg_replies(board_id, subject, body, recent_reply, mid, reply_id) VALUES($board_id, '$subject', '$body', '$date', $mid, $msg_id)")or die("Cannot create topic! " . @mysql_error()); @mysql_query("UPDATE msg_replies SET recent_reply='$date' WHERE msg_id=$msg_id LIMIT 1")or die("Cannot update topic! " . @mysql_error()); echo "<tr><td colspan=2><center><font color=red>Message posted!</center></font></td></tr>"; $body = ""; } echo "$page_options</td></tr> <tr><Td colspan=2><b>Post Reply</b></td></tr> <tr><td>To post a reply to this topic, please fill out the following form. HTML <i>is</i> allowed. <form action='boards.php?id=$board_id&msg=".@$_GET['msg']."' method=post> <b>Subject:<br> <input type=text name='subject' maxlength=75 value='$subject'><br> Body:<br> <textarea name='body' rows=10 cols=50></textarea><br><br> <input type=submit name='post_reply' value='Post it!'></form> "; // if a messageboard, but no topic, has been selected, display all topics }elseif($board_id){ if(@$_POST['post_topic']){ $subject = strip_tags(@$_POST['subject']); $body = @$_POST['body']; $date = date(YmdHis); if(!$subject){echo "<center><font color=red>Invalid Subject!";exit;} if(!$body){echo "<center><font color=red>You must include a message.";exit;} @mysql_query("INSERT INTO msg_replies(board_id, subject, body, date, recent_reply, mid) VALUES($board_id, '$subject', '$body', '$date', '$date', $mid)")or die("Cannot create topic! " . @mysql_error()); echo "<center><font color=red>Topic posted!</center></font>"; } echo " $page_options</td></tr> <tr><Td colspan=2><h1 width=500> <br><b>Post Topic</b></td></tr> <tr><td>To post a new topic, please fill out the following form. HTML <i>is</i> allowed. <form action='boards.php?id=$board_id' method=post> <b>Subject:<br> <input type=text name='subject' maxlength=75><br> Body:<br> <textarea name='body' rows=10 cols=50></textarea><br><br> <input type=submit name='post_topic' value='Post it!'></form> "; ?>
  11. I'm attempting to install home-coded message boards on a website, and they're working fine - apart from when you try to post. Then I get this error message: I'm still new to PHP, so I'd appreciate a few tips on why this is happening? If the code is needed then I can provide.
×
×
  • 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.