Jump to content

3raser

Members
  • Posts

    815
  • Joined

  • Last visited

Everything posted by 3raser

  1. Here is my code: <?php $image = ImageCreateFromPNG("image.png"); $color = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); $colorShadow = imagecolorallocate($image, 0x66, 0x66, 0x66); $font = 'arial'; $fontSize = "11"; $fontRotation = "0"; $message = $_POST['message']; $str = $message; /* Shadow */ ImageTTFText($image, $fontSize, $fontRotation, 7, 22, $colorShadow, $font, $str); /* Top Level */ ImageTTFText($image, $fontSize, $fontRotation, 5, 20, $color, $font, $str); header("Content-Type: image/PNG"); imagepng ($image); imagedestroy($image); ?> When you visit http://srl.comoj.com/submit.php (after you've typed in your message), it doesn't display the image.....it just gives me the image icon error or whatever you call it. The image you get when a image isn't working or it's invalid.
  2. Alright, I added that. Now: Parse error: syntax error, unexpected T_VARIABLE in /home/a2662105/public_html/info.php on line 8
  3. I guess it has something to do with $code Notice: Undefined index: code in /home/a2662105/public_html/info.php on line 5
  4. I'm not sure of what might be wrong. I'll look though.
  5. Ok, I put that code in. It shows this error: Fatal error: Call to undefined function display_errors() in /home/a2662105/public_html/info.php on line 3
  6. Bump
  7. Wtf, I can't edit my post?.... Well here is my new HTML code: <link rel="stylesheet" type="text/css" href="style.css" /> <br><br><form action='info.php' method='POST'><input type='text' name='code' size='16'><input type='submit' value='Go'></form>
  8. I don't think that'll work....
  9. <?php $code = $_POST['code']; $dbhost = "****"; $db = "****"; $dbuser = "****"; $dbpassword = "****"; //connecting to the database $connect = mysql_connect("$dbhost","$dbuser","$dbpassword") or die("Connection failed!"); mysql_select_db("$db") or die("Database fail!"); //extract $extract = mysql_query("SELECT * FROM info WHERE vipcode='$code'"); $numrows = mysql_num_rows($extract); while ($row = mysql_fetch_assoc($extract)) { if (!$row[levelofproject] || !$row[name] || !$row[id]){ echo "Invalid code! <a href='http://www.srl.comoj.com'>Home</a>"; } else { if ($row[progress] > 70) { $progress = "green"; } echo "Progress: <span style='color:". $progress ."'>". $row[progress] ."%</span>"; } } ?> And my HTML code: <link rel="stylesheet" type="text/css" href="style.css" /> <br><br><form action='info.php' method='POST'><input type='text' name='code' size='16' align='center'><a href='info.php' type='submit'><img src='Go.png' align='center' border='0'></a></img></form> <Br><br><br><br><br><b><font family='arial'>Warning: Best viewed in Google Chrome</font></b> When I type in a number, and then click the button it sends me to a blank page.......? It DOES send me to info.php, but it's a blank page.... [/code]
  10. Sorry, it just got cut off when I was copying and pasting.
  11. I'm not sure if PHP can make this happen.....but I'm trying to make a site that allows people to test their php codes. And this is my current code: <link rel="stylesheet" type="text/css" href="style.css" /> <?php $code = $_POST['code']; if (!$code){ echo "<form action='index.php' method='POST'><input type='submit' value='Submit'><br><textarea cols='120' rows='35' name='code'></textarea></form>"; } else { echo "<div align='left'><form action='index.php' method='POST'><input type='submit' value='Submit'><br><textarea cols='120' rows='35'></textarea></form></align><br>"; echo $code; } ?> And to see what happens, go here http://phptester.webatu.com/index.php
  12. No I didn't?
  13. That's basically like an offensive to me. -.- I have my database information...
  14. Bump
  15. Anyone?
  16. Code: //connecting to the database $connect = mysql_connect("$dbhost","$dbuser","$dbpassword") or die("Connection failed!"); mysql_select_db("$db") or die("Database fail!"); if (!$new) { echo "<form action='edit.php' method='POST'><textarea name='newmessage' rows='10' cols='40'></textarea><br><input type='submit' value='Edit'></fomr>"; } else { //extract $extract = mysql_query("SELECT * FROM posts WHERE id='$edit'"); $numrows = mysql_num_rows($extract); while ($row = mysql_fetch_assoc($extract)) { if ($row[username]==$session) { mysql_query("UPDATE posts SET message = $new WHERE id='$edit'"); echo "Message successfully changed."; } else { echo "This isn't your message to edit!"; } } } ?> Everytime I click edit, it doesn't do anything. It just sends me to a blank message after I type in my stuff and then click edit. Also, this is an error unrelated to this. If you can help me out real quick on this, I'd appreciate it: ". $row[id] ."<a href='edit.php?id=". $id ."'>[Edit]</a> This only appears as: edit.php?id= I don't know why nothing is showing up. (And yes I have my MySQL stuff correct and everything)
  17. Here is my code: if ($row[level] ==1){ if ($row[username]==$_SESSION[username]) { $message = "<div class='modusername'>". $row[username] ." Message #". $row[id] ."<a href='edit.php?id=". $id ."'>[Edit]</a><div class='moddate'>2-20-10</div></div><div class='messagemod'><div class='rank'>Rank: Administrator</div>". $row[message] ."</div><br>"; } else { $message = "<div class='modusername'>". $row[username] ." Message #". $row[id] ."<div class='moddate'>2-20-10</div></div><div class='messagemod'><div class='rank'>Rank: Administrator</div>". $row[message] ."</div><br>"; } }else { if ($row[username]==$_SESSION[username]) { $message = "<div class='username'>". $row[username] ." Message #". $row[id] ."<a href='edit.php?id=". $id ."'>[Edit]</a><div class='date'>2-20-10</div></div><div class='message'><div class='userrank'>Rank: User</div>". $row[message] ."</div><br>"; } else { $message = "<div class='username'>". $row[username] ." Message #". $row[id] ."<div class='date'>2-20-10</div></div><div class='message'><div class='userrank'>Rank: User</div>". $row[message] ."</div><br>"; } echo $message; } Here is my error: Parse error: syntax error, unexpected $end in /home/a9213080/public_html/index.php on line 42
  18. Here is my code: echo "<div class='username'>SRBuckey5266<div class='date'>2-20-10</div></div>"; Here is my CSS: body { background-color:white; color:white; } div.username { text-align:left; border-style:solid; border-width:1px; color:white; border-color:#282828; width:500px; height:20px; background-color:#787878; } div.date { text-align:right; color:white; } Why won't the date display?
  19. Is their a PHP code that allows you to search a file that is uploaded on my website?
  20. Anyone?...I need to go soon. -.-
  21. $keywords = $_POST['keywords']; //protection $before = array('(', ')', '^', '<', '>', '`', '*', '<script>', '</script>', ';DROP TABLE users;', 'users', 'DROP', 'TABLE'); $after = array('', '', '', '', '', '', '', '', '', '', '', '', ''); $output = str_replace($before, $after, $keywords); //display data $get = mysql_query("SELECT * FROM items WHERE keywords='$keywords'"); while ($row = mysql_fetch_assoc($get)) That only makes it get items that are the EXACT NAME. But how do I get it so it uses the keywords in the database? Like their is an Item named Pixel, you search pix and it doesn't work. But if you do Pixel, it will. :/
  22. Oh...I wish they didn't switch those. It's like...opposite.
  23. I keep running into this SAME problem. $text2 = "rise"; if ($row[changeprice] > 0) { $text2 = "drop"; } It's saying if it's below 0, change the text to drop. But why isn't it doing that? It still keeps it at rising.
  24. How come the "Change a Price" section doesn't show up once I do what you said?
  25. $password = $_POST['password']; if ($password =="pgpg7755opcd") { $itemid = $_POST['id']; $imagelink = $_POST['imagelink']; $name = $_POST['name']; $description = $_POST['description']; $price = $_POST['price']; $member = $_POST['member']; $noted = $_POST['noted']; $rare = $_POST['rare']; $nontradable = $_POST['nontradable']; $staffonly = $_POST['staffonly']; $lettercatagory = $_POST['lettercatagory']; if (!$itemid || !$name || !$description || !$price || !$lettercatagory) { echo '<tr><td colspan="5" style="color: #888888; font-style: italic;">Item ID: <form action="acp.php" method="POST"><input type="text" name="id"/></td></tr> <tr><td colspan="5" style="color: #888888; font-style: italic;">Image link: <input type="text" name="imagelink"/></td></tr> <tr><td colspan="5" style="color: #888888; font-style: italic;">Name: <input type="text" name="name"/></td></tr> <tr><td colspan="5" style="color: #888888; font-style: italic;">Description: <input type="text" name="description"/></td></tr> <tr><td colspan="5" style="color: #888888; font-style: italic;">Item Price: <input type="text" name="price"/></td></tr> <tr><td colspan="5" style="color: #888888; font-style: italic;">Member: <input type="text" name="member"/></td></tr> <tr><td colspan="5" style="color: #888888; font-style: italic;">Noted: <input type="text" name="noted"/></td></tr> <tr><td colspan="5" style="color: #888888; font-style: italic;">Rare: <input type="text" name="rare"/></td></tr> <tr><td colspan="5" style="color: #888888; font-style: italic;">Non-Tradable: <input type="text" name="tradable"/></td></tr> <tr><td colspan="5" style="color: #888888; font-style: italic;">Staff only: <input type="text" name="staffonly"/></td></tr> <tr><td colspan="5" style="color: #888888; font-style: italic;">Letter Category: <input type="text" name="lettercatagory"/><input type="submit"></form></td></tr>'; } else { mysql_query("INSERT INTO items VALUES ('', '$itemid', '$imagelink', '$name', '$description', '$price', '', '$member', '$noted', '$rare', '$nontradable', '$staffonly', '$lettercatagory', '', '')") or die(mysql_error()); echo "Item added!"; echo '<br></table> </div> </div> <div class="center"> Change a Price </div> <div class="inbox_body">'; $id = $_POST['itemid']; $price = $_POST['newprice']; if (!$id || !$price) { echo '<tr><td colspan="5" style="color: #888888; font-style: italic;">Item ID: <form action="acp.php" method="POST"><input type="text" name="itemid"/></td></tr> <tr><td colspan="5" style="color: #888888; font-style: italic;">New price: <input type="text" name="newprice"/><input type="submit"></form></td></tr>'; } else { //display data $get = mysql_query("SELECT * FROM items WHERE itemid='$id'"); while ($row = mysql_fetch_assoc($get)) { // get data $oldprice = $row['price']; } $change = $price - $oldprice; mysql_query("UPDATE items SET changeprice = $change WHERE itemid='$id'"); mysql_query("UPDATE items SET price = $price WHERE itemid='$id'"); mysql_query("UPDATE items SET beforeprice = $oldprice WHERE itemid='$id'"); echo "Item has been updated."; } else { if (!$password) { echo '<tr><td colspan="5" style="color: #888888; font-style: italic;">ACP Password: <form action="acp.php" method="POST"><input type="text" name="password"/></form></td></tr>'; } else { echo "Incorrect password."; } Error: Parse error: syntax error, unexpected T_ELSE in /home/a3993404/public_html/acp.php on line 369 I dont understand why it still tells me their is an error. :/
×
×
  • 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.