Jump to content

jcbarr

Members
  • Posts

    219
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

jcbarr's Achievements

Member

Member (2/5)

0

Reputation

  1. Sorry about that, here is a link that shows what it is doing. http://strife.cbl-baseball.com/promos.php?pid=11
  2. Okay so I have a form that is used to submit a rather large amount of text in to a MySQL database. Then I have a second page that displays said text. I have the column in the database formatted as longblob. Any time there are quotes or basically any kind of punctuation minus a period or comma it displays very strangely. Here is the code for the form; <? include("include/session.php"); ?> <html> <title>Backstage Area</title> <body bgcolor="#000000" style="font-family:tahoma;" text="#FFFFFF"> <table> <tr><td> <? /** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */ if($session->logged_in){ ?> <font size="2"> <h2>Create Roleplay</h2><P> <form method="post" action="process_roleplay.php"> Character: <? $sql="SELECT wrestler from users WHERE username='$session->username'"; $result=mysql_query($sql); $wrestler=mysql_fetch_array($result); echo "{$wrestler['wrestler']}"; ?> <BR><BR> Event: <select name="event"><? $sql="SELECT * from events ORDER BY date DESC LIMIT 2"; $result=mysql_query($sql); while ($event=mysql_fetch_array($result)){ echo "<option value='{$event['id']}'>{$event['name']} {$event['date']}</option>"; } ?></select><P> Title: <input type="text" name="title" maxlength="64"><P> Content:<br><textarea name="content" cols="75" rows="35"></textarea> <input type="hidden" value="<? echo "$session->username"; ?>" name="user"><br> <input type="submit" value="submit"> <input type="reset" value="reset"> </P></form> <br><br><br> <P> <? /* *Links to edit profile and whatnot are located here *Other things that you want to show up only if a user is logged in *can also be added before the else statement at this point */ echo "Welcome <b>$session->username</b>, you are logged in. <br><br>" ."[<a href=\"../index.php\">STRIFE Home</a>] " ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>] " ."[<a href=\"useredit.php\">Edit Pass/Email</a>] "; if($session->isAdmin()){ echo "[<a href=\"admin/admin.php\">Admin Center</a>] "; } echo "[<a href=\"index.php\">Backstage Home</a>] "; echo "[<a href=\"process.php\">Logout</a>]"; } else{ ?> </font><br><br><br> <h1>Login</h1> <? /** * User not logged in, display the login form. * If user has already tried to login, but errors were * found, display the total number of errors. * If errors occurred, they will be displayed. */ if($form->num_errors > 0){ echo "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>"; } ?> <form action="process.php" method="POST"> <table align="left" border="0" cellspacing="0" cellpadding="3"> <tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"></td><td><? echo $form->error("user"); ?></td></tr> <tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td><td><? echo $form->error("pass"); ?></td></tr> <tr><td colspan="2" align="left"><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>> <font size="2">Remember me next time <input type="hidden" name="sublogin" value="1"> <input type="submit" value="Login"></td></tr> <tr><td colspan="2" align="left"><br><font size="2">[<a href="forgotpass.php">Forgot Password?</a>]</font></td><td align="right"></td></tr> </table> </form> <? } ?> </td></tr> </table> </body> </html> Here is the code for the page that processes the form and inserts it in to the database; <? include("include/session.php"); ?> <html> <title>Backstage Area</title> <body bgcolor="#000000" style="font-family:tahoma;" text="#FFFFFF"> <table> <tr><td> <? /** * User has already logged in, so display relavent links, including * a link to the admin center if the user is an administrator. */ if($session->logged_in){ ?> <font size="2"> <? $eventid=$_POST['event']; $title=$_POST['title']; $content=$_POST['content']; $user=$_POST['user']; $sql="INSERT into roleplays (eventid, title, content, user) VALUES ('$eventid', '$title', '$content', '$user')"; if (mysql_query($sql)){ echo "Roleplay successfully created<P><a href=index.php>Return To Backstage Home</a>"; } else { echo "An Error occurred, contect administrator"; } ?> <br><br><br> <P> <? /* *Links to edit profile and whatnot are located here *Other things that you want to show up only if a user is logged in *can also be added before the else statement at this point */ echo "Welcome <b>$session->username</b>, you are logged in. <br><br>" ."[<a href=\"../index.php\">STRIFE Home</a>] " ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>] " ."[<a href=\"useredit.php\">Edit Pass/Email</a>] "; if($session->isAdmin()){ echo "[<a href=\"admin/admin.php\">Admin Center</a>] "; } echo "[<a href=\"index.php\">Backstage Home</a>] "; echo "[<a href=\"process.php\">Logout</a>]"; } else{ ?> </font><br><br><br> <h1>Login</h1> <? /** * User not logged in, display the login form. * If user has already tried to login, but errors were * found, display the total number of errors. * If errors occurred, they will be displayed. */ if($form->num_errors > 0){ echo "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>"; } ?> <form action="process.php" method="POST"> <table align="left" border="0" cellspacing="0" cellpadding="3"> <tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"></td><td><? echo $form->error("user"); ?></td></tr> <tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td><td><? echo $form->error("pass"); ?></td></tr> <tr><td colspan="2" align="left"><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>> <font size="2">Remember me next time <input type="hidden" name="sublogin" value="1"> <input type="submit" value="Login"></td></tr> <tr><td colspan="2" align="left"><br><font size="2">[<a href="forgotpass.php">Forgot Password?</a>]</font></td><td align="right"></td></tr> </table> </form> <? } ?> </td></tr> </table> </body> </html> And finally the page that displays the information from the database; $pid=$_GET['pid']; $event=$_POST['event']; ?> <? if (!isset($pid ) && !isset($event)){ ?> <form name="form1" action="<? echo $_SERVER['PHP_SELF']; ?>" method="post"> <center><B>SELECT EVENT: </B> <select name="event" onChange="document.form1.submit()"><option></option> <? $sql="SELECT * FROM events ORDER BY id DESC"; $a=mysql_query($sql, $link); while ($b=mysql_fetch_array($a)){ extract($b); echo "<option value='$id'>$name</option>"; } ?> </select> </center> </form><br /><br /> <? $sql="SELECT *, name FROM roleplays, bio WHERE bio.user=roleplays.user ORDER BY id DESC LIMIT 50"; $r=mysql_query($sql, $link); while($a=mysql_fetch_array($r)){ extract($a); echo "<img src='../images/rp/$user.jpg' align='left'> "; echo "<a href='{$_SERVER['PHP_SELF']}?pid=$id'>$title</a><br>"; echo " <b>Author:</b> $name<br>"; $sql2="SELECT name, eventid FROM events, roleplays WHERE events.id=roleplays.eventid"; $s=mysql_query($sql2, $link); $b=mysql_fetch_array($s); extract($b); echo " <b>$name</b>"; echo "<hr><br><br><br>"; } } ?> <? if (isset($pid) && !isset($event)){ $sql="SELECT * FROM roleplays WHERE id='$pid'"; $a=mysql_query($sql, $link); $b=mysql_fetch_array($a); extract($b); echo "<img src='../images/body/$user.jpg' align=right hspace=5 vspace=5>"; echo "<b><h2>$title</h2></b><P>"; echo nl2br($content); echo "<P><center><a href='../promos.php'>Back To Promos</a></center>"; } ?> <? if (!isset($pid) && isset($event)){ $sql="SELECT * FROM roleplays WHERE eventid='$event'"; $r=mysql_query($sql, $link); while($a=mysql_fetch_array($r)){ extract($a); echo "<img src='../images/rp/$user.jpg' align='left'> "; echo "<a href='{$_SERVER['PHP_SELF']}?pid=$id'>$title</a><br>"; echo " <b>Author:</b> $name<br>"; $sql2="SELECT name, eventid FROM events, roleplays WHERE events.id=roleplays.eventid"; $s=mysql_query($sql2, $link); $b=mysql_fetch_array($s); extract($b); echo " <b>$name</b>"; echo "<hr><br><br><br>"; } } ?> Any help at all on this would be great. I thought that I had it figured out once before but I am now lost again. If you type the information in to the form then it works fine. If you copy and paste from something like Notepad or Word, then that is where the problems occur. Thanks in advance for any help that is given.
  3. This was another instance of me being dumb. It was a simple copy and paste error. When you paste them in to the form they come out funky, but if you type them they are fine. I'm gonna mark this as solved, but if anyone does know why that would happen I would be interested.
  4. No ideas on this? Thanks, I promise I won't bump it anymore
  5. Here is the code that is being used to display it as well. <? if (isset($pid) && !isset($event)){ $sql="SELECT * FROM roleplays WHERE id='$pid'"; $a=mysql_query($sql, $link); $b=mysql_fetch_array($a); extract($b); echo "<img src='../images/body/$user.jpg' align=right hspace=5 vspace=5>"; echo "<b><h2>$title</h2></b><P>"; echo nl2br($content); echo "<P><center><a href='../promos.php'>Back To Promos</a></center>"; } ?>
  6. Yeah nl2br is normally good enough due to the fact that most people will actually hit return twice when they mean to start a new paragraph.
  7. I'm pulling data from a MySQL database that is formatted as text in the database but when I display it after calling from the query, apostrophes don't display correctly. They show up as a question mark enclosed in a diamond like shape. I believe the exclamation points do the same thing. I tried changing the format of the text to utf8_bin from Latin, but it still shows up that way. Am I missing something easy here?
  8. First thing to check is the permissions on the user account. If that still doesn't work then you need to use the MySQL command line function. Log in with the root user and password and then use the following command; set password for user@localhost = OLD_PASSWORD('password');
  9. Well, the problem is that I don't think that the mail is ever actually being sent. I'm trying to figure out how to check to see if the mail is ever leaving my server. If it is then I am pretty sure that I can figure out what is going on from there, but I don't have a clue how to configure the server to actually send mail.
  10. Sounds like a MySQL problem rather than a phpmyadmin problem. User your MySQL command script and use the following command; set password for user@host = OLD_PASSWORD('newpassword') That should straighten out your problem. Of course replace user, host and newpassword with the proper values.
  11. I just recently installed PHPNuke on my IIS 6 server. I have successfully configured php to work with IIS and it is serving up PHP pages with no problems it appears. I have run in to a little bit of a problem with it though. Users sign up for the page and they receive a message saying that they have successfully registered and that they should be getting a confirmation email within 24 hours to activate their account. The users, however, are never getting this email. The registration is somewhat working, as the users are being inserted in to the temp_users table, but it doesn't appear that any mail is actually being sent. I have installed the SMTP service to go along with IIS and have the ini set up to point to the localhost and use port 25 to send mail. I also have the SMTP server set up to only allow connections and mail to be sent from the localhost and no outside sources. Has anyone had any luck with setting this up, or know any way to point me to try to figure this out? I have looked over all the pages I can on google and they all tell me the same thing, "Configure your php.ini file and you should be fine." PHPNuke itself is generating no errors, but the confirmation email never gets sent and even the user feedback form does not send any mail. Any help or direction on this would be great. Thanks.
  12. I have done that. It doesn't matter what information is in that particular row, when I use that number it duplicates it instead of swapping it. Any other number combination works except for any that uses the number 72. It really makes no sense to me at all.
  13. That is the problem the table is huge. I checked and only one row where dorder is 72...I'm stumped...
×
×
  • 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.