Jump to content

johnseito

Members
  • Posts

    138
  • Joined

  • Last visited

Everything posted by johnseito

  1. <input name="firstname" type="text" value ="firstname"/> Does anyone know how to make the input value firstname in this example to a graycolor or any other color? thanks,
  2. I just tried, that code didn't work. It doesn't retain what was selected but have "select one" in the field after selecting an option and clicking on the submit button.
  3. print'<option value="'.$value.'"'.$sel.'>'.&#160; $value. '</option>\n'; something is wrong with this code, syntax, expected "&"
  4. I created an array to loop user's selection, but when the user select an item and click on the button it retains only the item (on the list) after. does someone know why, I assume it that when you select one item, then when you click the submit button the for loop runs again and select the next item on the list, retaining the wrong item. <tr><!--I LIVE IN-----------> <td align="right"> <?php print"$Live"; ?> </td> <td><select name="country"> <option value=""<?php if ($_POST['country'] == '') echo ' selected="selected"'; ?>>- Select One -</option> <?php $countries = array('Afghanistan','Aland Islands','Albania','Algeria','American Samoa','Andorra','Angola','Anguilla','Antarctica', 'Antigua and Barbuda','Argentina','Armenia','Aruba','Australia','Austria','Azerbaijan','Bahamas','Bahrain','Bangladesh','Barbados', 'Belarus','Belgium','Belize','Benin','Bermuda','Bhutan','Bolivia','Bosnia and Herzegovina','Botswana','Bouvet Island','Brazil', 'British Indian Ocean Territory','British Virgin Islands','Brunei','Bulgaria','Burkina Faso','Burundi','Cambodia','Cameroon','Canada', 'Cape Verde','Cayman Islands','Central African Republic','Chad','Chile','China','Christmas Island','Cocos (Keeling) Islands','Colombia', 'Comoros','Congo','Cook Islands','Costa Rica','Croatia','Cyprus','Czech Republic','Democratic Republic of Congo','Denmark','Disputed Territory', 'Djibouti','Dominica','Dominican Republic','East Timor','Ecuador','Egypt','El Salvador','Equatorial Guinea','Eritrea','Estonia','Ethiopia', 'Falkland Islands','Faroe Islands','Federated States of Micronesia','Fiji','Finland','France','French Guyana','French Polynesia', 'French Southern Territories','Gabon','Gambia','Georgia','Germany','Ghana','Gibraltar','Greece','Greenland','Grenada','Guadeloupe','Guam','Guatemala', 'Guinea','Guinea-Bissau','Guyana','Haiti','Heard Island and Mcdonald Islands','Honduras','Hong Kong','Hungary','Iceland','India','Indonesia','Iraq', 'Iraq-Saudi Arabia Neutral Zone','Ireland','Israel','Italy','Ivory Coast','Jamaica','Japan','Jordan','Kazakhstan','Kenya','Kiribati','Kuwait', 'Kyrgyzstan','Laos','Latvia','Lebanon','Lesotho','Liberia','Libya','Liechtenstein','Lithuania','Luxembourg','Macau','Macedonia','Madagascar', 'Malawi','Malaysia','Maldives','Mali','Malta','Marshall Islands','Martinique','Mauritania','Mauritius','Mayotte','Mexico','Moldova','Monaco','Mongolia', 'Montserrat','Morocco','Mozambique','Myanmar','Namibia','Nauru','Nepal','Netherlands','Netherlands Antilles','New Caledonia','New Zealand','Nicaragua', 'Niger','Nigeria','Niue','Norfolk Island','North Korea','Northern Mariana Islands','Norway','Oman','Pakistan','Palau','Palestinian Occupied Territories', 'Panama','Papua New Guinea','Paraguay','Peru','Philippines','Pitcairn Islands','Poland','Portugal','Puerto Rico','Qatar','Reunion','Romania','Russia', 'Rwanda','Saint Helena and Dependencies','Saint Kitts and Nevis','Saint Lucia','Saint Pierre and Miquelon','Saint Vincent and the Grenadines','Samoa', 'San Marino','Sao Tome and Principe','Saudi Arabia','Senegal','Serbia and Montenegro','Seychelles','Sierra Leone','Singapore','Slovakia','Slovenia', 'Solomon Islands','Somalia','South Africa','South Georgia and South Sandwich Islands','South Korea','Spain','Spratly Islands','Sri Lanka','Suriname', 'Svalbard and Jan Mayen','Swaziland','Sweden','Switzerland','Syria','Taiwan','Tajikistan','Tanzania','Thailand','Togo','Tokelau','Tonga','Trinidad and Tobago', 'Tunisia','Turkey','Turkmenistan','Turks And Caicos Islands','Tuvalu','Uganda','Ukraine','United Arab Emirates','United Kingdom','United Nations Neutral Zone', 'United States','United States Minor Outlying Islands','Uruguay','US Virgin Islands','Uzbekistan','Vanuatu','Vatican City','Venezuela','Vietnam', 'Wallis and Futuna','Western Sahara','Yemen','Zambia','Zimbabwe'); foreach ($countries as $value) { $sel = ($_POST['country'] == $value) ? ' selected="selected' : ''; print'<option value="'.$value.'"'.$sel.'>'. $value. '</option>\n'; } ?>
  5. Ok, that works. So how would you do this for a option field, where user selects one and code retain the one selected. </td> <td><select name="gender"> <option value="" selected>- Select One -</option> <option value="Male" >Male</option> <option value="Female" >Female</option></select><br></td>
  6. I have put the echo in and still no result. didn't work.
  7. Hello everyone, I created a simple userform to test. What I wanted to do is have the user input a field, and then click on the submitted button once the submitted button is click the page refresh and still retain what the user input (it is not lost). I know that to do this, we have to use the isset function, which I did, but it didn't work. Here are my codes, please provide some suggestion and code examples. <html> <head> <title></title> </head> <body> <form method ="post" action=""> <table border = 1 > <tr> <td> <?php session_start(); $firstname = (isset($_POST['firstname'])); $lastname = (isset($_POST[lastname]));?> First Name: <input name="firstname" type="text" value='<?php $firstname ?>'/></td> </td> </tr> <tr> <td> Last Name: <input name="lastname" type="text" value="' . $lastname . '"/></td> </td> </tr> <tr> <td> <input name="submit" type="submit" value="Enter the information"> </tr> </td> thanks,
  8. kenrbnsn -- I have looked at your code, it looks good, but here is the problem I am facing with your code. For example I wanted a form like your code only give one field per line. I did the two field or three field per line but what I am having trouble are with adding 2. Select an ID and password this to the form and adding style and width and height of the form and fields, etc. Do you know how I can do this? examples would be great. thanks,
  9. I am wondering why we use stripslashes on some of our codes? Is is b/c when we input info from userform the datas that we inputted going into a database is automatically add slashes to some of the words. so to get the data from the database to come out correct we need to use stripslashes? If I am wrong please explain and some code examples would be great. thanks,
  10. kenrbnsn, thanks, the code looks good. I'll analyzed it in detail.
  11. OK. I check your most updated code, and this is the result I get from it. I went to the browse and I see nothing accept this code, $tmp[] = '<input name="submit" type="submit" value="Enter the information">'; showing a button "enter the information". is the output of your code not producing the expected result? Once I see that your codes are working, I will see how the put back works and try doing it that way.
  12. kenrbnsn there is an error with this part of your code. $val = (isset($_POST[$fld] && $_POST[$fld] != $default_vals[$fld]))?htmlentities(stripslashes($_POST[$fld]),ENT_QUOTES):'$default_vals[$fld]'; Here is a problem. Lets say the user click on the submit button after filling in the inputs, is there a way I can retain what they inputted when they click the submit button? For example, if there is 10 field and the user fill in 3 fields, and the rest blank, my code will highlight what they left out as blank in red, but also empty, and refresh everything the user enter before, so they have to start inputting everything again. Is there a code, or a way to solve this that would retain what they inputted earlier in the field so they don't have to retype everything and continue on with what they missed?
  13. using the trim works. I also think that some of you misunderstand my point, for example if I have a field coded like this <input name="state" type="text" value ="- Enter State -"/> value as "-enter state-" to guild users so they know what to input, b/c I have value as enter state, it is not blank anymore, and even if user didn't enter anything in this field it is not blank. so how do I go about solving this? One way I can think of it, make the code equal to -enter state - and if it does means it's blank. How do I do when a user click in this field with a value to clear the value and how do I make this value gray out so it makes the appearance look nicer? maybe this can only be done using javascript?
  14. could you provide some javascript code example that will go hand in hand with php and mysql that will do that. I am looking for some at the moment, I am not too familiar with javascript.
  15. using this isn't any different than if $_POST['uname'] == '' { or !$_POST['uname'], I just tried it. if a user input blank space, it think it is not blank. maxudaskin $gender = empty($_POST['gender']) ? "Unknown" : $_POST['gender']; what does this code do, I tried it and don't see any result.
  16. peranha--- that look like it might work, I did it with your concept, but code it a little differently. There is a problem, one of it I came across is that, for example some fields I have values in them to guild user to input the correct information. This makes the field not blank anymore, so it screws up my coding logic. Now even if a user didn't fill in this field it think it did b/c this field is not really blank. Do you know how I can get around this? I would like it that if I click in the field that is blank with values, it clears out the value. Do you know how I can do this? thanks,
  17. What does this have to do with user filling in the field or not? please explain. DarkWater -------- you know what I mean right, if I was to do if statement for every scenario, there will be tons of if statement, for example with 10 variable, there is more than 10 scenario, just like a lottery ticket, if there are 7 number there is tons of combination in how to mix and match those 7 numbers.
  18. Hello everyone, I created a form for user to fill in, this form has 10 field such as name,, gender, birthday, country, etc. What I want to do is have the user fill in all the fields, and if they miss 1 or 2, or 3 etc of the field, I want to mark the word next to the field red of the ones they didn't fill in and said you did not fill in all the fields. the problem I have doing this is that, there is 10 variables, and so there will be a lot of IF statement combination to cover all 10 scenario, making it a lot of IF statement. I was wondering if there is a efficient way of doing this. Let me know of your Suggestion, and code example. thanks,
  19. Hello everyone, I created a web form with html and some php using mainly Mozilla Firefox for it's appearance. It looks nice as how I wanted it in FireFox, but when I open it in internet explorer, the appearance of the form looks totally different. It's appearance is out of wack. Does anyone know why and how I can fix this for all browser? Thanks,
  20. I just looked at Zend Studio and it is too expensive. $800
  21. I tried using it by pressing f7, f8 etc it doesn't work, it is gray out, and when I ask the guy who programed php desinger 08, he keep on stalling and telling me this and that, and all he told me never works. how does it work, or how do i use that feature if it works? thanks,
  22. Hello everyone, What php - mysql editor have step into, step over, step out and breakpoint editor? can you list all editor that you know of that has this. I currently use php designer and it doesn't have any of that. thanks,
  23. Hello everyone, I haven't been using mysql in a while now, and I forgot the password. So how can I find this out, is there a code that would help show my old password? thanks,
×
×
  • 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.