PravinS
Members-
Posts
459 -
Joined
-
Last visited
-
Days Won
2
Everything posted by PravinS
-
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); ?>
-
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
-
you can check it like this if (is_array($_POST['interest']) && count($_POST['interest']) > 0) { // code here }
-
do you know URL rewriting? check : http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
-
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
-
use php explode() function http://www.php.net/manual/en/function.explode.php
-
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>'; } ?>
-
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(); ?>" />
-
can you show us the actual code
-
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
-
use urlencode() and urldecode() functions
-
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'];
-
you can check this example http://www.w3schools.com/php/php_ajax_database.asp
-
try uncommenting the if condition <?php //$ab=1; $ab = ''; if(isset($_GET['id'])) $ab= $_GET['id']; echo $ab; ?>
-
check http://www.phpclasses.org/package/5927-PHP-Display-an-hierarchic-menu-stored-in-a-MySQL-table.html
-
You can also use TCPDF http://www.tcpdf.org/
-
check the syntax of INSERT query http://dev.mysql.com/doc/refman/5.6/en/insert.html
-
input to "mysql_real_escape_string()" function should be string and you have passed array to it, so you are getting this error if possible paste your code here
-
MYSQL HELP ... i find very difficult... need help...
PravinS replied to Luther_Caloring's topic in MySQL Help
try using this SQL query SELECT received, SUM(amount) as amt FROM TABLE_NAME GROUP BY received; -
if you want to use server side valiation then you can use "filter_var" function to check the email or else you can use javascript email validation http://www.php.net/manual/en/function.filter-var.php
- 4 replies
-
- validation
- php
-
(and 1 more)
Tagged with:
-
try replacing this code <form action="add_bk_insert.php"> Name <input type="text" name="name"/><br /> E-mail <input type="text" name="email" /><br /> Contact <input type="text" name="contact" /><br /> Requirement <input type="text" name="requirement" /><br /> <input type="submit" value="Submit" name="btnSubmit"/> </form> <?php mysql_connect("localhost","root",""); mysql_select_db("test"); if (isset($_POST['btnSubmit'])) { $name = isset($_POST[name]) ? $_POST[name] : ''; $email_id = isset($_POST[email_id]) ? $_POST[email_id] : ''; $contact = isset($_POST[contact]) ? $_POST[contact] : ''; $requirement = isset($_POST[requirement]) ? $_POST[requirement] : ''; $order = "INSERT INTO sal2 (name,email_id, contact,requirement) VALUES('".$name."','".$email_id."','".$contact."','".$requirement."')"; $result = mysql_query($order); if($result) { echo "Inserted"; //include_once("testimonials.php"); } else{ echo("<br>Input data is fail"); } } ?>