Jump to content

Madatan

Members
  • Posts

    51
  • Joined

  • Last visited

    Never

Everything posted by Madatan

  1. Thats great! One question however. How do I show the pictures? I guess echo is the wrong command?
  2. yes, that is one way, I will try it and see if it suffice for my purpose. Thanks
  3. Okey, I simply wanna know if this is possible and if so then how. What I wanna do is being able to upload pictures and store them in a database, is this possible with mysql? And how would such a thing look? Would you use this kind of code? [code] insert into bla_bla (picid, name) VALUES('','???'); [/code]
  4. Okey so I got a login form thats sending the password to a database, I want the password to be converted into md5. How do I do that? and then, how do I do in the login area so it read it as md5? [code] form id="form1" name="form1" method="post" action="">     <input type="text" name="anv" />   </p> <p>Email: <input name="email" type="text" id="email" /> </p> <p>L&ouml;senord: <input name="losen" type="password" id="losen" /> <input name="ranger" type="submit" id="ranger" value="Register" /> </p> </form> [/code]
  5. Okey, so I got a news-system with an admin area and all that, now I just want the news system to format the text a little bit by itself. So if I write: Hello my name is George! Good bye! I dont want to have to add the two [code]<br><br>[/code] to make it a new row and another row between the two sentences. Anyone following? :P
  6. [code]<form name="form1" method="post" action="">   <p align="center">     <input type="submit" name="Submit" value="Preview">     <br>     <textarea name="practice" cols="100" rows="20"></textarea>     </p> </form> <?php $practice = $_POST['practice']; if ($practice == NULL) { echo 'empty'; } elseif(isset($_POST['Submit'])) { echo $practice; } ?>[/code]
  7. [code]<form name="form1" method="post" action=""> <input type="hidden" name="gorgeusgeorge" value="1">   <p align="center">     <input type="submit" name="Submit" value="Preview">     <br>     <textarea name="practice" cols="100" rows="20"></textarea>     </p> </form> <?php $practice = $_POST['practice']; if ($practice == NULL) { echo 'empty'; } elseif($gorgeusgeorge == '1') { echo $practice; } ?>[/code] You could also uset isset but there are issues in IE with that.
  8. Okey, so I simply want a number taken from a database add a , on some good places. For example: 10000000 = 10,000,000 How do I do this? didn't know what to search for so I ask in the forum.
  9. This is weird, i'm having problems with[code] if(isset($_POST['submit']))[/code] to work with IE and Opera. Works perfectly with FireFox. Any clue why?
  10. [!--quoteo(post=380617:date=Jun 6 2006, 09:51 AM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Jun 6 2006, 09:51 AM) [snapback]380617[/snapback][/div][div class=\'quotemain\'][!--quotec--] I think your error may be in your query: $query = "UPDATE mud_armour SET equipped = '1' WHERE arid = '$change'"; Change it to: $query = "UPDATE mud_armour SET equipped = '1' WHERE arid = '" . $_POST['change'] . "'"; [/quote] Thank you so much! I've been trying to get this to work the last 24 hours and it truly have made me insane.
  11. [!--quoteo(post=380606:date=Jun 6 2006, 09:16 AM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Jun 6 2006, 09:16 AM) [snapback]380606[/snapback][/div][div class=\'quotemain\'][!--quotec--] I'm going to guess it's because you're nesting a form inside of a table. Put your form tags outside of the table (you can obviously leave the input fields in the table) and see what happens. Also, it's good practice to put the action attribute in the form even if you're submitting to the same page. And I assume you mean "equip" instead of "attack", because that's how it is coded. [/quote] Yes I mean equip of course :) I changed everything now, moving the form out of the table but I wont get a value anyway :/ so that didn't work. I guess I have to figure out something else!
  12. [!--quoteo(post=380088:date=Jun 4 2006, 07:53 PM:name=2RIP)--][div class=\'quotetop\']QUOTE(2RIP @ Jun 4 2006, 07:53 PM) [snapback]380088[/snapback][/div][div class=\'quotemain\'][!--quotec--] I'm trying to make a login section for my homepage. It says Your login must be sent by HTTP_POST and have the following structure: And the Login Code: <form action="first_protected_page_after_login.php" method="POST"> <input type="hidden" name="action" value="login"> <input type="text" name="userName"> <input type="password" name="userPass"> <input type="submit"> </form> Logout code: <form action="some_existing_protected_page.php" method="POST"> <input type="hidden" name="action" value="logout"> What is HTTP_Post and how am i suppose to combine these codes together to make a login block on my webpage? Also I i want to resize the width of the text area, where should i add width="185" ?? [/quote] The method="POST" is the HTTP_POST and therefor you don't have to add anything. Anyway, you have to make a login page that checks if the username and password exists and if they are correct. But thats another story. <input type="text" name="userName" size="145" /> Thats what you can use. Good Luck.
  13. [!--quoteo(post=380558:date=Jun 6 2006, 06:47 AM:name=witt)--][div class=\'quotetop\']QUOTE(witt @ Jun 6 2006, 06:47 AM) [snapback]380558[/snapback][/div][div class=\'quotemain\'][!--quotec--] Shouldn't you have something like action="getform.php" ? [/quote] no because the script I want to start is not in another php file but in the same... thats the reason why I use if(isset($_POST['attack'])) when I click the button named attack it will do the code in that if statement.
  14. I've done this kind of things many times before... and yet I can't get it to work this time. The code down here simply wont send a value from the Form. Can anyone see why? [code] <? session_start(); include 'dbconnect.php'; $Button = $_SESSION['charactername']; $query = "SELECT * FROM mud_users WHERE name = '$Button'"; $result = mysql_query($query) or die('Error : ' . mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); $rowid = $row['id']; //EQUIP if(isset($_POST['equip'])) { //Change don't get a value $query = "UPDATE mud_armour SET equipped = '1' WHERE arid = '$change'"; $result = mysql_query($query) or die('Error : ' . mysql_error()); } $query = "SELECT * FROM mud_armour WHERE ownerid = '$rowid' AND equipped = '0'"; //Torso $result = mysql_query($query) or die('Error : ' . mysql_error()); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { ?> <tr> <td><span class="style4"><b> Unequipped</b>:<br> Name: <? echo $row['name']; ?></span></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td><form id="yes" name="jak" method="post"> <input name="add" type="text" value="<? echo $row['arid']; ?>"> //This is change, it's supposed to get a value from the database. It does but it wont send the value. <input name="change" type="hidden" value="<? echo $row['arid']; ?>"> <input name="equip" type="submit" value="Equip"> </form> </td> </tr> <? } ?> </table> [/code]
  15. [!--quoteo(post=380076:date=Jun 4 2006, 07:08 PM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ Jun 4 2006, 07:08 PM) [snapback]380076[/snapback][/div][div class=\'quotemain\'][!--quotec--] #1 [code] <? if($gnarf == '1' && $yoda == true) {   header("Location : ".$_SERVER['PHP_SELF']); } ?> [/code] #2 Is a javascript question. [/quote] Okey, good to know it's a javascript then. But I can't get it to refresh the page anyway, nothing happens when using that header code... any clue?
  16. Okey, since i'm a noob when it comes to PHP I wonder if there is any function that will refresh the current page every time you run it. I want something like this: [code] <? if($gnarf == '1' && $yoda == true) { refresh the page code here } ?> [/code] Okey, so to my next question. If I got a form with a button, let's call this button Hello. What I want to do with this button is make it impossible to click for, let's say 2,4seconds. Is this possible?
  17. Okey, so here is my problem. Down here I got some code, there are of course database connections higher up but thats not necessary at the moment, I guess. Anyway, what I want this form to do(any kind of link would suffice) is to send the data that will be shown in the button from the 'name' row in the database to another page. This page could be for example start.php. I then want to be able to use the 'name' thats been clicked in start.php Does anyone understand what I want? :P [code]<? while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { ?> Name: <form id="form2" name="form2" method="post" action=""> <input type="submit" name="<? echo $row['name']; ?>" value="<? echo $row['name']; ?>" /> </form> <? } ?>[/code]
  18. Okay so here is the scenario. I've got two tables that I want to be connected(let's call the A and B), so I made a third table. In table A and B i got two primary keys a_id and b_id. Now I create the third table named AB. Inside that I create ab_id as primary and two foreign keys with the names a_id and b_id..... all is all good right now, working fine. Now to the issue, what should I write in the code to get example ab_id 1 to show all it's information. And by all information I mean all the info that a_id and b_id have in their tables. You get what I'm looking for here? Does this require some kind of JOIN?
  19. I see, thanks for that info.
  20. [!--quoteo(post=351595:date=Mar 4 2006, 10:13 AM:name=wickning1)--][div class=\'quotetop\']QUOTE(wickning1 @ Mar 4 2006, 10:13 AM) [snapback]351595[/snapback][/div][div class=\'quotemain\'][!--quotec--] I believe foreign keys are supported if you create an InnoDB table, but MyISAM does not support them. You can read about the various differences between InnoDB and MyISAM in the mysql documentation. [/quote] I see, good to know. That helps alot, can I combine MyISAM and InnoDB or do I have to make all the connected tables of the same type? For example, can I have a foreign key in a InnoDB table that references to a MyISAM table?
×
×
  • 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.