purge08 Posted August 7, 2015 Share Posted August 7, 2015 <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Deck Master</title> <style media="screen"> body { background-color:#f0f0f0; } #input-holder { padding:20px; border:1px solid #999; border-radius:10px; background-color:#fff; box-shadow:inset 0 0 20px #999, 3px 3px 3px #999; overflow:hidden; text-align:center; } #left-input{ float:left; overflow:hidden; } #right-input{ float:right; overflow:hidden; } #center-input{ display:inline-block; } .qty,.pht { float:left; } .qty { margin-right:10px; } .qty input { display:block; width:24px; margin-top:10px; } .pht input { display:block; width:130px; margin-top:10px; } @media screen and (max-width:650px) { #left-input,#right-input,#center-input{ float:none; display:block; margin:0 auto 10px; text-align:center; } .qty,.pht { float:none; display:inline-block; } } </style> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head> <body background="background.jpg"><form name="frmEditCards" method="post"> <input type="hidden" name="Name" value="frmEditCards"> <form action="process.php" method="post"> <table border="0" width="100%"> <tr> <td valign="top" align="Center"> <h1> <font color="white">Deck Editor <small>(60 cards)</small> </h1> <div id="input-holder"> <div id="left-input"> <font color="black"> <label class="qty">Qty <input type="text" placeholder=""> </label> <label class="pht">Card Name <input type="text" placeholder=""> </div> <div id="right-input"> <font color="black"><label class="qty">Qty <input type="text" placeholder=""> </label> <label class="pht">Card Name <input type="text" placeholder=""> </label> </div> <div id="center-input"> <font color="black"><label class="qty">Qty <input type="text" placeholder=""> </label> <label class="pht">Card Name <input type="text" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" placeholder=""> </label> <label class="pht"> <input type="text" placeholder=""> </label> </div> </div> </table> <td colspan="2" align="center" name="Submit Deck"><input type="submit"></td> </body> </html> I am trying to use my submit form in html to post using php into orchard content management system in a user's blog. What I mean is, user uses form and the data is to be posted on the user's blog page with the deck name as a link on the blog and after clicking the link would show all the outputted data of the deck list they submitted. Trying to figure out how to get the submitted information onto the user's blog? Deck name will be added to form later on. <?php print "qty". $qty; print "card name". $cardname; ?> I am a beginner in php, so any help will be greatly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/ Share on other sites More sharing options...
ginerjm Posted August 8, 2015 Share Posted August 8, 2015 And this "orchard content management system" - you have the api for it and you have read up on how to use it, so that you can write your php code to do your thing? Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518235 Share on other sites More sharing options...
purge08 Posted August 8, 2015 Author Share Posted August 8, 2015 The api i have is for the magic the gathering card viewer and prices, would i need another api, and if so, what would it be? Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518239 Share on other sites More sharing options...
ginerjm Posted August 8, 2015 Share Posted August 8, 2015 That is for you to find out. And once you do, start writing the code to do what you want to do. And then when you have a problem the forum is here to help you out - if you can't get help from the 'magic' people or the 'orchard' people Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518241 Share on other sites More sharing options...
purge08 Posted August 8, 2015 Author Share Posted August 8, 2015 <?php $card = 'black lotus'; $qty = 4; echo '<?php echo\'$card\'; ?>'; echo '<?php echo\'$qty\'; ?>'; ?> Testing to get variables to show up. Nothing shows up when using localhost to view it executed but not getting any line errors so far. trying to figure out how to get the $qty and $card variable to show up when running the script on localhost. Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518252 Share on other sites More sharing options...
Ch0cu3r Posted August 8, 2015 Share Posted August 8, 2015 You do not use PHP tag syntax within a PHP echo statement to output variables. You use the variable inside the string. A few examples // with strings defined with double quotes variables are expanded echo "Your card is: $card<br />"; echo "Have ordered: $qty"; // with strings defined with single quotes variables are NOT expanded, you must use concatenation echo 'Your card is: '.$card.'<br />'; echo 'Have ordered: '.$qty; // or as separate echo statements echo 'Your card is: '; echo $card; echo '<br />'; echo 'Have ordered: '; echo $qty; PHP documentaion on strings and echo http://php.net/manual/en/language.types.string.php http://php.net/manual/en/function.echo.php   The only time you would use PHP tags would be when you go in and out of PHP mode, example <?php $card = 'black lotus'; $qty = 4; ?> Your card is: <?php echo $card; ?><br /> Have ordered: <?php echo $qty; ?> Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518260 Share on other sites More sharing options...
purge08 Posted August 8, 2015 Author Share Posted August 8, 2015 The script is not for ordering cards. It's as a deck builder such as people entering the qty and card names of the cards and then it echo's them to show up on a page. That is why I have only the word qty and card, and not of your card is, and you have ordered.  What I mean is : Output to come out like this.  4 dark ritual 4 phyrexian dreadnought 4 juzam djinn 4 illusionary mask 22 swamps 4 duress 1 mox jet  Basically exports all that onto a page showing the quantity and card names only. It is not for an online store as I already have one. It is to allow players of the card game to input their deck lists and it outputs them onto a page. That is why I posted qty and name only in echo statements. Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518267 Share on other sites More sharing options...
purge08 Posted August 8, 2015 Author Share Posted August 8, 2015 The one html form has 30 qty and 30 card name placeholders. Another one of the same type will have 100 qty and 100 name placeholders, so what I am trying to do is process what the user enters and output it as such.  24 LANDS 4 Llanowar Wastes 4 Mana Confluence 4 Sandsteppe Citadel 3 Windswept Heath 2 Caves of Koilos 2 Forest 2 Temple of Silence 1 Urborg, Tomb of Yawgmoth 1 Plains 1 Temple of Plenty  26 CREATURES 4 Anafenza, the Foremost 4 Warden of the First Tree 4 Siege Rhino 4 Rakshasa Deathdealer 4 Fleecemane Lion 3 Brimaz, King of Oreskos 2 Herald of Torment 1 Surrak, the Hunt Caller  10 INSTANTS and SORC. 4 Dromoka's Command 3 Ultimate Price 3 Valorous Stance  SIDEBOARD 1 Ultimate Price 1 Valorous Stance 1 Herald of Torment 1 Gods Willing 1 Tasigur, the Golden Fang Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518269 Share on other sites More sharing options...
mac_gyver Posted August 8, 2015 Share Posted August 8, 2015 some tips -  1) you would dynamically produce the form, rather than writing out all that repetitive markup. you would either allow the user to enter (an input box) or select (a select/option dropdown) the number of fields to produce or you would display a base number of fields and have an 'add' button that would dynamically add more fields.  2) form fields need a name='...' attribute to cause the data to be submitted. for sets of data, you would use an array for the name so that you can process the data using php's array functions. see this link for using an array for form fields - http://php.net/manual/en/faq.html.php#faq.html.arrays  3) if the names of the cards are specific (i.e. the user cannot make up card names), you would want to provide a way of letting the user select from the existing card names. by requiring the user to type in a card name you will have all kinds of problems with misspelling and making it too hard for the user to enter data.  4) to display the card names for selection, you would either display all them at once, ordered by category and/or name, or if you have a large number of card names, provide a search box, category selection menu/links, or use pagination to limit what's being displayed at one time.  in short, define your user entry form so that it easy for the user to pick/enter the data, give the form fields array name's so that the data will be submitted at all and it will be submitted as arrays of data, then it will be easy for you to write the php code that processes the submitted data. Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518276 Share on other sites More sharing options...
purge08 Posted August 8, 2015 Author Share Posted August 8, 2015 I have a html form that allows the user to enter the qty and card names. I am trying to figure out variables to output what the user typed in htm form to output into like a process.php or something as I am just learning variables and testing to get it to show up. That is why I had black lotus and qty of 4 in the php code to see if I can get it to show up such as the example of having it say hello world but instead be that of what the user filled out on the form. Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518293 Share on other sites More sharing options...
purge08 Posted August 8, 2015 Author Share Posted August 8, 2015 I will be using an Api for the card names and images, I just want to figure out how to get the html form I made to output using php as a test run before I have it imprint into the users blog. That is why I am starting with variables and seeing if that will post the $qty and $card in the above php script. Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518294 Share on other sites More sharing options...
Ch0cu3r Posted August 8, 2015 Share Posted August 8, 2015 You need to do as mac_gyver suggested for 2) in his reply. If you do not give names to the fields used in your form no data will be submitted to PHP.   That is why I am starting with variables and seeing if that will post the $qty and $card in the above php script. PHP no longer automatically defines variables based on the names of the fields used in your form, ie if you had a field in your form called  name  (older versions of) php would of defined a variable called  $name  which would contain the value for the name form field. This is no longer the case instead you must use the $_POST or $_GET superglobal array (depending on your form submit method) to get that fields value, which will be  $_POST['name']  to get the value for field named  name  See the following documentation http://php.net/manual/en/tutorial.forms.php http://php.net/manual/en/language.variables.external.php http://php.net/manual/en/language.variables.superglobals.php Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518298 Share on other sites More sharing options...
mac_gyver Posted August 8, 2015 Share Posted August 8, 2015 (edited) I have a html form ... Â no you don't. the html you posted at the top of this thread is a mess. it has two nested opening <form ...> tags and aside from the hidden form field, the form fields don't have name='....' attributes. you did give a name attribute to a <td ...> element that looks like it belongs in the submit button and there is no closing </form> tag. Â to do this thing called programing, you must first learn the basics. if you don't know the correct syntax for a <form ....> ... </form> at all, you will never get a form to work for your data. unless you can get one form field to submit to your php code, there's no point in writing out the html for more than one form field (and i as stated, you should let the computer write out multiple same meaning form fields.) you need to read a book, or take a class, or study up-to-date tutorials in order to learn the basics of writing forms and writing php code to process those forms, because you cannot do this just by throwing things together that you may have seen somewhere. Edited August 8, 2015 by mac_gyver Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518317 Share on other sites More sharing options...
purge08 Posted August 11, 2015 Author Share Posted August 11, 2015 <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Deck Master</title> <style media="screen"> body { background-color:#f0f0f0; } #input-holder { padding:20px; border:1px solid #999; border-radius:10px; background-color:#fff; box-shadow:inset 0 0 20px #999, 3px 3px 3px #999; overflow:hidden; text-align:center; } #left-input{ float:left; overflow:hidden; } #right-input{ float:right; overflow:hidden; } #center-input{ display:inline-block; } .qty,.pht { float:left; } .qty { margin-right:10px; } .qty input { display:block; width:24px; margin-top:10px; } .pht input { display:block; width:130px; margin-top:10px; } @media screen and (max-width:650px) { #left-input,#right-input,#center-input{ float:none; display:block; margin:0 auto 10px; text-align:center; } .qty,.pht { float:none; display:inline-block; } } </style> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head> <body background="background.jpg"><form action="index.php" method="post"> <input type="hidden" name="Name" value="deckeditor"> <table border="0" width="100%"> <tr> <td valign="top" align="Center"> <h1> <font color="white">Deck Editor <small>(60 cards)</small></h1> <body> <form> <div id="input-holder"> <div id="left-input"> <font color="black"> <label class="qty">Qty <input type="text" name="qty1" placeholder=""> </label> <label class="pht">Card Name <input type="text" name="card1" placeholder=""> </div> <div id="right-input"> <font color="black"><label class="qty">Qty <input type="text" name="qty2" placeholder=""> </label> <label class="pht">Card Name <input type="text" name="card2" placeholder=""> </label> </div> <div id="center-input"> <font color="black"><label class="qty">Qty <input type="text" name="qty3" placeholder=""> </label> <label class="pht">Card Name <input type="text" name="card3" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" name="qty4" placeholder=""> </label> <label class="pht"> <input type="text" name="card4" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" name="qty5" placeholder=""> </label> <label class="pht"> <input type="text" name="card5" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" name="qty6" placeholder=""> </label> <label class="pht"> <input type="text" name="card6" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" name="qty7" placeholder=""> </label> <label class="pht"> <input type="text" name="card7" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" name="qty8" placeholder=""> </label> <label class="pht"> <input type="text" name="card8" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" name="qty9" placeholder=""> </label> <label class="pht"> <input type="text" name="card9" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" name="qty10" placeholder=""> </label> <label class="pht"> <input type="text" name="card10" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" name="qty11" placeholder=""> </label> <label class="pht"> <input type="text" name="card11" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" name="qty12" placeholder=""> </label> <label class="pht"> <input type="text" name="card12" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" name="qty13" placeholder=""> </label> <label class="pht"> <input type="text" name="card13" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" name="qty14" placeholder=""> </label> <label class="pht"> <input type="text" name="card14" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" name="qty15" placeholder=""> </label> <label class="pht"> <input type="text" name="card15" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" name="qty16" placeholder=""> </label> <label class="pht"> <input type="text" name="card16" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" name="qty17" placeholder=""> </label> <label class="pht"> <input type="text" name="card17" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" name="qty18" placeholder=""> </label> <label class="pht"> <input type="text" name="card18" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" name="qty19" placeholder=""> </label> <label class="pht"> <input type="text" name="card19" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" name="qty20" placeholder=""> </label> <label class="pht"> <input type="text" name="card20" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" name="qty21" placeholder=""> </label> <label class="pht"> <input type="text" name="card21" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" name="qty22" placeholder=""> </label> <label class="pht"> <input type="text" name="card22" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" name="qty23" placeholder=""> </label> <label class="pht"> <input type="text" name="card23" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" name="qty24" placeholder=""> </label> <label class="pht"> <input type="text" name="card24" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" name="qty25" placeholder=""> </label> <label class="pht"> <input type="text" name="card25" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" name="qty26" placeholder=""> </label> <label class="pht"> <input type="text" name="card26" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" name="qty27" placeholder=""> </label> <label class="pht"> <input type="text" name="card27" placeholder=""> </label> </div> <br> <div id="left-input"> <label class="qty"> <input type="text" name="qty28" placeholder=""> </label> <label class="pht"> <input type="text" name="card28" placeholder=""> </div> <div id="right-input"> <label class="qty"> <input type="text" name="qty29" placeholder=""> </label> <label class="pht"> <input type="text" name="card29" placeholder=""> </label> </div> <div id="center-input"> <label class="qty"> <input type="text" name="qty30" placeholder=""> </label> <label class="pht"> <input type="text" name="card30" placeholder=""> </label> </div> </div> <input type="submit" value="Submit deck" </table> </body> </form> </html> Re-edited code. Â The form does go to the index.php when i hit submit, and tried to use $get or $post to see if the entered data on the html would post and nothing showed up on the index.php. is there something wrong or that i am missing on how to get it to show up? <?php $_get['qty1'] $_get['card1'] echo ($_post[qty2]); echo ($_post[qty3]); echo ($_post[qty4]); echo ($_post[qty5]); echo ($_post[qty6]); echo ($_post[qty7]); echo ($_post[qty8]); echo ($_post[qty9]); echo ($_post[qty10]); echo ($_post[qty11]); echo ($_post[qty12]); echo ($_post[qty13]); echo ($_post[qty14]); echo ($_post[qty15]); echo ($_post[qty16]); echo ($_post[qty17]); echo ($_post[qty18]); echo ($_post[qty19]); echo ($_post[qty20]); echo ($_post[qty21]); echo ($_post[qty22]); echo ($_post[qty23]); echo ($_post[qty24]); echo ($_post[qty25]); echo ($_post[qty26]); echo ($_post[qty27]); echo ($_post[qty28]); echo ($_post[qty29]); echo ($_post[qty30]); ?> Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518483 Share on other sites More sharing options...
ginerjm Posted August 11, 2015 Share Posted August 11, 2015 (edited) As mentioned before - you REALLY need to read something to learn about PHP. Your last code sample is still a MESS. Two opening form tags, but only one closing one that I can see. You've invested an awful lot of time in layout but very little in designing the simple mechanics of html and form input handling. Â 1 - Turn on php error checking. It will help you. (See my signature) 2 - Hint - there is no such variable as $_post. A little bit of php knowledge will teach you that. 3 - Proper array syntax is $variable['index'] which you are not doing. 4 - You are doing a form POST so why the use of (incorrect) $_get references? Â If my question puzzle you and make you think that I'm being unfair, consider it your first lesson in how to learn to program. You think this is easy? It CAN be -if you do your homework. Edited August 11, 2015 by ginerjm Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518498 Share on other sites More sharing options...
purge08 Posted August 11, 2015 Author Share Posted August 11, 2015 I'm using udemy to learn but trying to figure out how echo get or post works in at least one of the fields to show up on index.php Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518543 Share on other sites More sharing options...
purge08 Posted August 11, 2015 Author Share Posted August 11, 2015 The php link they gave me post and get variables with the $like that Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518544 Share on other sites More sharing options...
purge08 Posted August 11, 2015 Author Share Posted August 11, 2015 I meant us to the link above that one of the posters posted. Also what do you mean by two openings? I only see one PHP open and one PHP close tag? Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518545 Share on other sites More sharing options...
purge08 Posted August 12, 2015 Author Share Posted August 12, 2015 A couple other things i found where $_post were used in php script  As easily as a user can monkey with GET data in a URL, the same thing can be done with POST data. You should always assume that the user can submit whatever form and form data that they want to, and process the data accordingly. Don’t trust user input, whether it’s from GET or from POST! Post data is accessed with the $_POST array in PHP. <?php    echo("First name: " . $_POST['firstname'] . "<br />\n");    echo("Last name: " . $_POST['lastname'] . "<br />\n"); ?>    <form action="myform5.php" method="post">    <p>First name: <input type="text" name="firstname" /></p>    <p>Last name: <input type="text" name="firstname" /></p>    <input type="submit" name="submit" value="Submit" /> </form> Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518549 Share on other sites More sharing options...
ginerjm Posted August 12, 2015 Share Posted August 12, 2015 Do you not even know how to write plain text to communicate? Â Of your last 4 posts above this one, the first 3 make no sense at all! And the latest one is fraught with errors even while trying to teach something. Are you trying to tell the Forum about the dangers of trusting user input? I think most people here already know that and try to impart that to those that don't. Â PLEASE try and learn this: Do Not Use $_post. It is not what you think it is! One of the first things about PHP that you will learn if you ever really try to learn it is that the language is CASE-SENSITIVE. Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518592 Share on other sites More sharing options...
mac_gyver Posted August 12, 2015 Share Posted August 12, 2015 @purge08, we are not trying to give you a hard time. however, this thing called programming requires that you learn what every character in every line of code means, so that you will know what it does, so you will know if it even belongs in your code or where it belongs in your code to accomplish a goal. Â to do this, you cannot simply follow along with things you have seen. you must really learn what they mean. Â until you learn and understand how to write a simple form and php code to process that form, you are not ready to do this for your data. forget about writing out 30 different sets of form/php code. that's just a waste of your time at this point (and as i wrote above, you should be letting the computer do the repetitive work of creating the form fields and processing the form data, rather than you writing out all this code.) Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518598 Share on other sites More sharing options...
purge08 Posted August 12, 2015 Author Share Posted August 12, 2015 I was just posting from one of the websites trying to teach php where I got a post example from Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518604 Share on other sites More sharing options...
ginerjm Posted August 12, 2015 Share Posted August 12, 2015 Like mac_gyver says - learn what you are copying before you try to use it. If you "find" some piece of code, look up every part of it in the manual to see what it is doing and to LEARN from it. Â Can I ask: Is English not your primary language? Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518621 Share on other sites More sharing options...
purge08 Posted August 12, 2015 Author Share Posted August 12, 2015 actually english and 6 other languages. Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518626 Share on other sites More sharing options...
purge08 Posted August 13, 2015 Author Share Posted August 13, 2015 I was using a php form generator, and had noticed it uses .$_REQUEST, would that be what I would use for my form? Quote Link to comment https://forums.phpfreaks.com/topic/297685-form-submittal-help/#findComment-1518668 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.