Jump to content

PravinS

Members
  • Posts

    459
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by PravinS

  1. you can use PHP time zone instead of javascript time zone
  2. remove the back ticks (``) from VALUES of INSERT query and use single quotes (' ') $query = "INSERT INTO user(user,pass,priv,mail,avatar,date) VALUES('$user','$pass','$priv','$mail','$avatar','$date')"; may this works for you
  3. check the SQL query, whose resource id is passed to mysql_fetch_array() function at mentioned line or else show us the code of C:\xampp\htdocs\index.php
  4. use this updated javascript function function checkForm() { var obj = document.getElementsByName('dest[]'); var destCount = obj.length; var destSel = false; for(var i = 0; i < destCount; i++) { if(obj[i].checked == true) destSel = true; } if(destSel == false) { alert('Select one or more destinations'); } return destSel; }
  5. use this code <html> <head> <script language="javascript"> function checkForm(){ var obj = document.getElementsByName('dest[]'); var destCount = obj.length; var destSel = false; for(i = 0; i < destCount; i++){ if(obj.checked == false){ destSel = true; break; } } if(!destSel){ alert('Select one or more destinations'); } return destSel; } </script> </head> <body> Select at least one destination <form action="" method="post"> <input id="cx" type="checkbox" name="dest[]" value="CX" /> <label for="cx">Cox's Bazar</label><br /> <input id="su" type="checkbox" name="dest[]" value="SU" /> <label for="su">Sundarban</label><br /> <input id="sy" type="checkbox" name="dest[]" value="SY" /> <label for="sy">Sylhet</label><br /> <input id="ch" type="checkbox" name="dest[]" value="CH" /> <label for="ch">Chittagong</label><br /> <br /> <input type="submit" name="Go" value=" Go " onclick="return checkForm();"/> </form> </body> </html> also check the jsfiddle
  6. Just remove onsubmit="return checkForm(this);" from form tag and add it to button as onclick="return checkForm(this);" Use this <form action="" method="post"> <input id="cx" type="checkbox" name="dest[]" value="CX" /> <label for="cx">Cox's Bazar</label><br /> <input id="su" type="checkbox" name="dest[]" value="SU" /> <label for="su">Sundarban</label><br /> <input id="sy" type="checkbox" name="dest[]" value="SY" /> <label for="sy">Sylhet</label><br /> <input id="ch" type="checkbox" name="dest[]" value="CH" /> <label for="ch">Chittagong</label><br /> <br /> <input type="submit" name="Go" value=" Go " onclick="return checkForm(this);"/> </form>
  7. your php code should be like this <?php // Always try to connect and select the DB before anything else $con = mysql_connect("localhost", "jingleko_reload", "*******") or die("Couldnt Connect to DB - ".mysql_error()); mysql_select_db("jingleko_reloader", $con) or die("Couldnt Select a DB - ".mysql_error()); // Set post var $Epost = trim(addslashes(strip_tags($_POST['Epost']))); if (isset($_POST['Epost'])) { // Look for it in DB $query = "SELECT Epost FROM newsletter WHERE Epost='".$Epost."'"; $result = mysql_query($query); //If found, do next thing if (mysql_num_rows($result) > 0) { mysql_query("DELETE FROM newsletter WHERE Epost='$Epost'") or die(mysql_error()); echo "<div align=\"center\"><img src=\"Pics/Vlaamse Leeuw.jpg\" width=\"114\" height=\"127\" border=\"0\"></div>"; echo "<p align=\"center\"><b>Thank you, you are now removed from the list.</b></p><br>"; echo "<p align=\"center\"><a href=\"index.htm\"><img src=\"Pics/begin.gif\" width=\"95\" height=\"30\" border=\"0\"></a></p>"; } else { echo "<div align=\"center\"><b><font color=\"red\">This address does not exist</font></b></div><br>"; echo "<div align=\"center\"><a href=\"eruit.htm\"><img src=\"Pics/herbegin.gif\" width=\"95\" height=\"30\" border=\"0\"></a>"; echo "<a href=\"index.htm\"><img src=\"Pics/begin.gif\" width=\"95\" height=\"30\" border=\"0\"></a></div>"; } } mysql_close($con); ?>
  8. you can use isset() function to check if $_FILES['image'] is set of not like if (isset($_FILES['image'])) { // your code here var_dump($_FILES['image']); // your code here } may this will help you
  9. you can check it like this if (is_array($_POST['interest']) && count($_POST['interest']) > 0) { // code here }
  10. do you know URL rewriting? check : http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
  11. i think your code should be like this $event = array("Flash Flood Watch", "Flash Flood Warning", "Severe Thunderstorm Watch", "Severe Thunderstorm Warning", "Torndao Watch", "Torndao Warning"); $searchvalue = "Flash Flood Watch"; //as example if (in_array($searchvalue, $event)) { echo "Match found"; } also go through in_array() function properly http://www.php.net/in_array
  12. use php explode() function http://www.php.net/manual/en/function.explode.php
  13. give name as array for each field, as <?php foreach ($items as $item) { echo'<div class="items-row"> <label for="name_'.$item['item_id'].'">'.$item['item_name'].'</label> <div class="item_input"><input type="text" name="quantity[]" id="'.$item['item_name'].'" value="0"></div> <input type="hidden" name="item_ids[]" value="'.$item['item_id'].'"> <input type="hidden" name="user_ids[]" value="'.$moving_basics_id.'"> </div>'; } ?>
  14. your function should return the value like <?php function test() { $response = "hello"; return $response; } ?> and then you can call the function like this <input type="textbox" name="xx" value="<?php echo test(); ?>" />
  15. can you show us the actual code
  16. it means you haven't created database on your local machine or the database connection in database.php is not correct
  17. at this line add mysql_error() like this and check what is the issue $data=mysql_query("SELECT OT.nostaf, OT.otl_tkh_m, OT.otl_tkh_y ,OT.otl_jum_jam, OT.otl_jabatan FROM ot_line OT") or die(mysql_error());
  18. mysql_select_db("ahamdabad_vpn_ip$", $dbc); $sql = "select main_system from ahamdabad_vpn_ip$"; "ahamdabad_vpn_ip$" is you database or table name? also it is not good practice to use "$" in database of table name
  19. use urlencode() and urldecode() functions
  20. echo the SQL query and execute it in phpmyadmin also write mysql_close($con); at the end the bottom of the code
  21. check you SQL query, remove space between FROM and table name from SQL query $query ="SELECT * From Section order by sectCode ASC";
  22. your form method is post, so use POST while getting variable data $destinationCode=$_POST['destinationcode']; $numberofadults=$_POST['numberofadults']; $numberofchildren=$_POST['numberofchildren']; $startdate=$_POST['stardate']; $enddate=$_POST['enddate'];
  23. you can check this example http://www.w3schools.com/php/php_ajax_database.asp
  24. try uncommenting the if condition <?php //$ab=1; $ab = ''; if(isset($_GET['id'])) $ab= $_GET['id']; echo $ab; ?>
  25. check http://www.phpclasses.org/package/5927-PHP-Display-an-hierarchic-menu-stored-in-a-MySQL-table.html
×
×
  • 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.