-
Posts
840 -
Joined
-
Last visited
-
Days Won
1
Everything posted by gristoi
-
your not closing your form off after each loop. the </form> is missing. so you have ended up with a load of inputs with the same name (cardID) . php will be passed the last one in the form with that name
-
bootstrap : http://getbootstrap.com/
-
sorry, what do you mean by incorporate? if you mean set the value of the input in php then do this: <input type="text" name="number2" value="<?= $number1 ?>"/>
-
changing the word INSERT INTO with UPDATE wont make the query magically update. read the manual and look at the difference between inserting and updating: http://dev.mysql.com/doc/refman/5.0/en/update.html
-
you need to read up a little on your javascript. you used JQUERY not AJAX. $('form').submit(function(event){ event.preventDefault(); var checkedVal = $('input[type=radio]:checked').val(); $.ajax({ type: "POST", url: 'myscript1.php', data: checkedVal, success: function(){ // make second callback here}, dataType: dataType }); }); });
-
you cannot post to two different url's in one go. If you need to shoot some information off to 2 scripts sequentially then you can do it using ajax. On click fire off first ajax call, in the callback response you could then fire the second request.
-
you dont need 2 queries, have a google on using mysql joins: this should get you started: SELECT p.people_id, p.name, p.age, d.data_id, d.info FROM TBL_PEOPLE p INNER JOIN TBL_DATA d USING (people_id) WHERE p.age = 50;
-
A: google it B: pick up a php book and learn c: hire a php developer
-
<?php class World { private $chosenCountry; public $world_countries = array( "GB" => "United Kingdom", "US" => "United States", "AF" => "Afghanistan", "AL" => "Albania", "DZ" => "Algeria", "AS" => "American Samoa", "AD" => "Andorra", "AO" => "Angola", "AI" => "Anguilla", "AQ" => "Antarctica", "AG" => "Antigua And Barbuda", "AR" => "Argentina", "AM" => "Armenia", "AW" => "Aruba", "AU" => "Australia", "AT" => "Austria", "AZ" => "Azerbaijan", "BS" => "Bahamas", "BH" => "Bahrain", "BD" => "Bangladesh", "BB" => "Barbados", "BY" => "Belarus", "BE" => "Belgium", "BZ" => "Belize", "BJ" => "Benin", "BM" => "Bermuda", "BT" => "Bhutan", "BO" => "Bolivia", "BA" => "Bosnia And Herzegowina", "BW" => "Botswana", "BV" => "Bouvet Island", "BR" => "Brazil", "IO" => "British Indian Ocean Territory", "BN" => "Brunei Darussalam", "BG" => "Bulgaria", "BF" => "Burkina Faso", "BI" => "Burundi", "KH" => "Cambodia", "CM" => "Cameroon", "CA" => "Canada", "CV" => "Cape Verde", "KY" => "Cayman Islands", "CF" => "Central African Republic", "TD" => "Chad", "CL" => "Chile", "CN" => "China", "CX" => "Christmas Island", "CC" => "Cocos (Keeling) Islands", "CO" => "Colombia", "KM" => "Comoros", "CG" => "Congo", "CD" => "Congo, The Democratic Republic Of The", "CK" => "Cook Islands", "CR" => "Costa Rica", "CI" => "Cote D'Ivoire", "HR" => "Croatia (Local Name: Hrvatska)", "CU" => "Cuba", "CY" => "Cyprus", "CZ" => "Czech Republic", "DK" => "Denmark", "DJ" => "Djibouti", "DM" => "Dominica", "DO" => "Dominican Republic", "TP" => "East Timor", "EC" => "Ecuador", "EG" => "Egypt", "SV" => "El Salvador", "GQ" => "Equatorial Guinea", "ER" => "Eritrea", "EE" => "Estonia", "ET" => "Ethiopia", "FK" => "Falkland Islands (Malvinas)", "FO" => "Faroe Islands", "FJ" => "Fiji", "FI" => "Finland", "FR" => "France", "FX" => "France, Metropolitan", "GF" => "French Guiana", "PF" => "French Polynesia", "TF" => "French Southern Territories", "GA" => "Gabon", "GM" => "Gambia", "GE" => "Georgia", "DE" => "Germany", "GH" => "Ghana", "GI" => "Gibraltar", "GR" => "Greece", "GL" => "Greenland", "GD" => "Grenada", "GP" => "Guadeloupe", "GU" => "Guam", "GT" => "Guatemala", "GN" => "Guinea", "GW" => "Guinea-Bissau", "GY" => "Guyana", "HT" => "Haiti", "HM" => "Heard And Mc Donald Islands", "VA" => "Holy See (Vatican City State)", "HN" => "Honduras", "HK" => "Hong Kong", "HU" => "Hungary", "IS" => "Iceland", "IN" => "India", "ID" => "Indonesia", "IR" => "Iran (Islamic Republic Of)", "IQ" => "Iraq", "IE" => "Ireland", "IL" => "Israel", "IT" => "Italy", "JM" => "Jamaica", "JP" => "Japan", "JO" => "Jordan", "KZ" => "Kazakhstan", "KE" => "Kenya", "KI" => "Kiribati", "KP" => "Korea, Democratic People's Republic Of", "KR" => "Korea, Republic Of", "KW" => "Kuwait", "KG" => "Kyrgyzstan", "LA" => "Lao People's Democratic Republic", "LV" => "Latvia", "LB" => "Lebanon", "LS" => "Lesotho", "LR" => "Liberia", "LY" => "Libyan Arab Jamahiriya", "LI" => "Liechtenstein", "LT" => "Lithuania", "LU" => "Luxembourg", "MO" => "Macau", "MK" => "Macedonia, Former Yugoslav Republic Of", "MG" => "Madagascar", "MW" => "Malawi", "MY" => "Malaysia", "MV" => "Maldives", "ML" => "Mali", "MT" => "Malta", "MH" => "Marshall Islands", "MQ" => "Martinique", "MR" => "Mauritania", "MU" => "Mauritius", "YT" => "Mayotte", "MX" => "Mexico", "FM" => "Micronesia, Federated States Of", "MD" => "Moldova, Republic Of", "MC" => "Monaco", "MN" => "Mongolia", "MS" => "Montserrat", "MA" => "Morocco", "MZ" => "Mozambique", "MM" => "Myanmar", "NA" => "Namibia", "NR" => "Nauru", "NP" => "Nepal", "NL" => "Netherlands", "AN" => "Netherlands Antilles", "NC" => "New Caledonia", "NZ" => "New Zealand", "NI" => "Nicaragua", "NE" => "Niger", "NG" => "Nigeria", "NU" => "Niue", "NF" => "Norfolk Island", "MP" => "Northern Mariana Islands", "NO" => "Norway", "OM" => "Oman", "PK" => "Pakistan", "PW" => "Palau", "PA" => "Panama", "PG" => "Papua New Guinea", "PY" => "Paraguay", "PE" => "Peru", "PH" => "Philippines", "PN" => "Pitcairn", "PL" => "Poland", "PT" => "Portugal", "PR" => "Puerto Rico", "QA" => "Qatar", "RE" => "Reunion", "RO" => "Romania", "RU" => "Russian Federation", "RW" => "Rwanda", "KN" => "Saint Kitts And Nevis", "LC" => "Saint Lucia", "VC" => "Saint Vincent And The Grenadines", "WS" => "Samoa", "SM" => "San Marino", "ST" => "Sao Tome And Principe", "SA" => "Saudi Arabia", "SN" => "Senegal", "SC" => "Seychelles", "SL" => "Sierra Leone", "SG" => "Singapore", "SK" => "Slovakia (Slovak Republic)", "SI" => "Slovenia", "SB" => "Solomon Islands", "SO" => "Somalia", "ZA" => "South Africa", "GS" => "South Georgia, South Sandwich Islands", "ES" => "Spain", "LK" => "Sri Lanka", "SH" => "St. Helena", "PM" => "St. Pierre And Miquelon", "SD" => "Sudan", "SR" => "Suriname", "SJ" => "Svalbard And Jan Mayen Islands", "SZ" => "Swaziland", "SE" => "Sweden", "CH" => "Switzerland", "SY" => "Syrian Arab Republic", "TW" => "Taiwan", "TJ" => "Tajikistan", "TZ" => "Tanzania, United Republic Of", "TH" => "Thailand", "TG" => "Togo", "TK" => "Tokelau", "TO" => "Tonga", "TT" => "Trinidad And Tobago", "TN" => "Tunisia", "TR" => "Turkey", "TM" => "Turkmenistan", "TC" => "Turks And Caicos Islands", "TV" => "Tuvalu", "UG" => "Uganda", "UA" => "Ukraine", "AE" => "United Arab Emirates", "UM" => "United States Minor Outlying Islands", "UY" => "Uruguay", "UZ" => "Uzbekistan", "VU" => "Vanuatu", "VE" => "Venezuela", "VN" => "Viet Nam", "VG" => "Virgin Islands (British)", "VI" => "Virgin Islands (U.S.)", "WF" => "Wallis And Futuna Islands", "EH" => "Western Sahara", "YE" => "Yemen", "YU" => "Yugoslavia", "ZM" => "Zambia", "ZW" => "Zimbabwe" ); public function display_countries() { asort($this->world_countriess); foreach ($this->world_countries as $key => $value) { echo $key . ' > <a target="_blank" href="https://www.google.se/?gws_rd=cr#fp=bac353e51a633d27&q=' . $value . '">' . $value . '</a><br>'; } } public function eeti_world_options($args) { asort($this->world_countries); $outout = '<select name="country">'; foreach ($this->world_countries as $key => $value) { if ($this->$value == $args) { $outout .= '<option value="' . $key . '" selected>' . $value . '</option>'; } else { $outout .= '<option value="' . $key . '">' . $value . '</option>'; } } $outout .= '</select>'; return $outout; } public function setWorldCountry($country){ $this->chosenCountry = $this->world_countries[$country]; } public function getWorldCountry(){ return $this->chosenCountry; } } ?> <?php $world = new World(); if (isset($_POST['submit'])) { $world->setWorldCountry($_POST['country']); // print out the selected country echo 'you have chosen :'. $world->getCountry(); } ?> <form method="post" action="class-world.php"> <?php echo $world->eeti_world_options('Uganda'); ?> <input type="submit" name="submit"> </form>
- 5 replies
-
- php
- associative arrays
-
(and 2 more)
Tagged with:
-
google 'turning on php error reporting' that should point you in the direction of what is killing your site
-
my personal preference is ubuntu LTS. is stable and suitable for my coding needs. I never bother with unity stuff though. but prefer to just install cairo dock, my ide, mysql workbench and chrome. From that am ready to rock. never failed me yet
-
have just been looking through the documentation during my lunch hour ( i know sad, looking at code all day, then more code at lunch lol ) and it does look very good. Will be playing with this after work i think
- 12 replies
-
- fuelphp
- codeigniter
-
(and 1 more)
Tagged with:
-
this is a forum for helping people to learn php and to solve their coding problems. Showing a screenshot of a generic page and saying ' make it work' wont get you very far. if you want someone to write a script for you then you are better off moving this post to the freelancing section and paying for someone to do your work. thanks
-
what are you asking for?
-
trq, can you see it being around for a while?
- 12 replies
-
- fuelphp
- codeigniter
-
(and 1 more)
Tagged with:
-
personally i am in the same boat as you. I am working with symfony 2 and loving it, but am looking to play with a new framework. The only thing putting me off laravel is that there is no big community behind it at the moment, and i am worried if i run with it that it could die off in the next year. Hopefully not though
- 12 replies
-
- fuelphp
- codeigniter
-
(and 1 more)
Tagged with:
-
checking if forms are filled on submission
gristoi replied to ryanmetzler3's topic in PHP Coding Help
I am afraid kashiflatif90 is incorrect. that if statement will only ever be true if ALL fields are empty on submission . you should use || instead of && -
View variable in the same line as the counter for
gristoi replied to Erison's topic in PHP Coding Help
try: <div> <?php $i = 0; while($arrParcelas = mysql_fetch_array($sqlParcelas)){ $dataX = $arrParcelas['dataPagamento']; $parcelasX = $arrParcelas['parcelaPaga']; $valorX = $arrParcelas['valorPago']; if($i == $parcelasX) { echo $parcelasX . " - " . $valorX . " <br /> "; } ?> </div> <?php $i++; } ?> -
You are only echoing an error or. Not killing script. You need to do return anywhere you want the script to stop
-
Sorry, I make it a point not to do other peoples homework
-
google is your friend: http://www.htmlgoodies.com/beyond/css/article.php/3891201
-
i cant see anything in the code that defines $old_image