Results 41 to 44 of 44
-
30th Mar 2012, 02:55 PM #41OPMemberWebsite's:
heroturko.biz softpk.com gfxtra.biz hotfilegfx.comtype is not show i am submit form but show Arry is not type name
Please check checkbox
Form Code:
PHP Code:<div class="toggle_container">
<div class="block">
<form enctype="multipart/form-data" action="add.php" method="POST">
<center><b><h7>Vendor Service Request</h7></b></center>
<div class="columns clearfix">
<div class="col_50">
<fieldset>
<label class="hospitalname">Hospital Name</label>
<div>
<input type="text" name="hospname" class="long">
</div>
</fieldset>
</div>
<div class="col_50">
<fieldset>
<label>Ref No.</label>
<div>
<input type="text" name="refno" class="long">
</div>
</fieldset>
</div>
</div>
<div class="columns clearfix">
<div class="col_50">
<fieldset>
<label>From</label>
<div>
<input type="text" name="from" class="long">
</div>
</fieldset>
</div>
<div class="col_50">
<fieldset>
<label>Description</label>
<div>
<input type="text" name="description" class="long">
</div>
</fieldset>
</div>
</div>
<div class="columns clearfix">
<div class="col_50">
<fieldset>
<label>Designation</label>
<div>
<input type="text" name="designation" class="long">
</div>
</fieldset>
</div>
<div class="col_50">
<fieldset>
<label>Manufacture</label>
<div>
<input type="text" name="manufacture" class="long">
</div>
</fieldset>
</div>
</div>
<div class="columns clearfix">
<div class="col_50">
<fieldset>
<label>Tel Number</label>
<div>
<input type="text" name="telnumb" class="long">
</div>
</fieldset>
</div>
<div class="col_50">
<fieldset>
<label>Models</label>
<div>
<input type="text" name="models" class="long">
</div>
</fieldset>
</div>
</div>
<div class="columns clearfix">
<div class="col_50">
<fieldset>
<label>Mobile Number</label>
<div>
<input type="text" name="mobnumb" class="long">
</div>
</fieldset>
</div>
<div class="col_50">
<fieldset>
<label>Serial numbers</label>
<div>
<input type="text" name="serialnumb" class="long">
</div>
</fieldset>
</div>
</div>
<div class="columns clearfix">
<div class="col_50">
<fieldset>
<label>Fax</label>
<div>
<input type="text" name="fax" class="long">
</div>
</fieldset>
</div>
<div class="col_50">
<fieldset>
<label>Equipment</label>
<div>
<input type="text" name="equipment" class="long">
</div>
</fieldset>
</div>
</div>
<div class="columns clearfix">
<div class="col_50">
<fieldset>
<label>Email address</label>
<div>
<input type="text" name="emailadd" class="long">
</div>
</fieldset>
</div>
<div class="col_50">
<fieldset>
<label class="attachment">Attachement</label>
<div>
<input type="file" id="fileupload2" name="attachement" class="uniform">
</div>
</fieldset>
</div>
</div>
<div class="columns clearfix">
<div class="col_50">
<fieldset>
<label>Type</label>
<div class="uniform">
<label for="yes">
<input type="checkbox" name="type[]" value="AG" id="yes"/>
Warranty
</label>
<label for="no">
<input type="checkbox" name="type[]" value="GE" id="no"/>
PPM Contact
</label>
<label for="cant">
<input type="checkbox" name="type[]" value="BR" id="no"/>
Repair argent
</label>
</fieldset>
</div>
<div class="col_50">
<fieldset>
<label>Fault Description And Service Description</label>
<div>
<textarea height="50px" name="faultdsd" class="long"></textarea>
</div>
</fieldset>
</div>
</div>
<div class="padding_10">
<button type="submit" value="Add" class="button blue"> <img src="images/icons/white/png/checkmark_icon&16.png" /> Submit </button>
<div class="clear"></div><!-- CLEAR BOTH -->
</div>
</form>
</div>
</div>
</div>
add.php
PHP Code:<?php
//This is the directory where images will be saved
$target = "vendor-req-service/";
$target = $target . basename( $_FILES['attachement']['name']);
if(isset($_POST['type']))
{
foreach($_POST['type'] as $value) {
$insert="INSERT INTO type (type) VALUES ('$value')";
mysql_query($insert);
}
}
//This gets all the other information from the form
$id=$_POST['ClientID'];
$hospname=$_POST['hospname'];
$refno=$_POST['refno'];
$from=$_POST['from'];
$description=$_POST['description'];
$designation=$_POST['designation'];
$manufacture=$_POST['manufacture'];
$telnumb=$_POST['telnumb'];
$models=$_POST['models'];
$mobnumb=$_POST['mobnumb'];
$serialnumb=$_POST['serialnumb'];
$fax=$_POST['fax'];
$equipment=$_POST['equipment'];
$emailadd=$_POST['emailadd'];
$insert=$_POST['type'];
$faultdsd=$_POST['faultdsd'];
$pic=($_FILES['attachement']['name']);
// Connects to your Database
mysql_connect("localhost", "username", "password") or die(mysql_error()) ;
mysql_select_db("my_db") or die(mysql_error()) ;
//Writes the information to the database
mysql_query("INSERT INTO `vendor` VALUES ('$id', '$hospname', '$refno', '$from', '$description', '$designation', '$manufacture', '$telnumb', '$models', '$mobnumb', '$serialnumb', '$fax', '$equipment', '$emailadd', '$pic', '$insert', '$faultdsd')") ;
//Writes the photo to the server
if(move_uploaded_file($_FILES['attachement']['tmp_name'], $target))
{
//Tells you if its all ok
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory";
}
else {
//Gives and error if its not
echo "Sorry, there was a problem uploading your file.";
}
?>
-
30th Mar 2012, 03:03 PM #42Respected MemberWebsite's:
DL4Everything.com Soft2050.inReplace
PHP Code:<label for="yes">
<input type="checkbox" name="type[]" value="AG" id="yes"/>
Warranty
</label>
<label for="no">
<input type="checkbox" name="type[]" value="GE" id="no"/>
PPM Contact
</label>
<label for="cant">
<input type="checkbox" name="type[]" value="BR" id="no"/>
Repair argent
</label>
PHP Code:<label for="yes">
<input type="checkbox" name="type" value="Warranty" id="yes">
Warranty
</label>
<label for="no">
<input type="checkbox" name="type" value="PPM Contact" id="no"/>
PPM Contact
</label>
<label for="cant">
<input type="checkbox" name="type" value="Repair argent" id="cant"/>
Repair argent
</label>
Edit: As for file download, replace in Full View Record Code:
PHP Code:print ("<label class='hospitalname'>{$a_row['attachement']}</label>" );
PHP Code:print ("<label class='hospitalname'><a href=\"vendor-req-service/{$a_row['attachement']}\">{$a_row['attachement']}</a></label>" );
-
30th Mar 2012, 05:45 PM #43OPMemberWebsite's:
heroturko.biz softpk.com gfxtra.biz hotfilegfx.comshow this error
Warning: Invalid argument supplied for foreach() in G:\WampDeveloper\Websites\DefaultWebsite\webroot\t est4\add.php on line 9 The file has been uploaded, and your information has been added to the directory
Line 9 is:
PHP Code:foreach($_POST['type'] as $value) {
PHP Code:<?php
//This is the directory where images will be saved
$target = "vendor-req-service/";
$target = $target . basename( $_FILES['attachement']['name']);
if(isset($_POST['type']))
{
foreach($_POST['type'] as $value) {
$insert="INSERT INTO type (type) VALUES ('$value')";
mysql_query($insert);
}
}
//This gets all the other information from the form
$id=$_POST['ClientID'];
$hospname=$_POST['hospname'];
$refno=$_POST['refno'];
$from=$_POST['from'];
$description=$_POST['description'];
$designation=$_POST['designation'];
$manufacture=$_POST['manufacture'];
$telnumb=$_POST['telnumb'];
$models=$_POST['models'];
$mobnumb=$_POST['mobnumb'];
$serialnumb=$_POST['serialnumb'];
$fax=$_POST['fax'];
$equipment=$_POST['equipment'];
$emailadd=$_POST['emailadd'];
$insert=$_POST['type'];
$faultdsd=$_POST['faultdsd'];
$pic=($_FILES['attachement']['name']);
// Connects to your Database
mysql_connect("localhost", "zain", "pimsat") or die(mysql_error()) ;
mysql_select_db("zain") or die(mysql_error()) ;
//Writes the information to the database
mysql_query("INSERT INTO `vendor` VALUES ('$id', '$hospname', '$refno', '$from', '$description', '$designation', '$manufacture', '$telnumb', '$models', '$mobnumb', '$serialnumb', '$fax', '$equipment', '$emailadd', '$pic', '$insert', '$faultdsd')") ;
//Writes the photo to the server
if(move_uploaded_file($_FILES['attachement']['tmp_name'], $target))
{
//Tells you if its all ok
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory";
}
else {
//Gives and error if its not
echo "Sorry, there was a problem uploading your file.";
}
?>
-
1st Apr 2012, 08:44 PM #44Respected Member
change
PHP Code:if(isset($_POST['type']))
PHP Code:if(is_array($_POST['type']))
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[Selling] Excellent Matrimonial Script| Complete readymade Matrimony Script Available
By matriscript4u in forum Marketplace (Buy, Sell and Trade)Replies: 0Last Post: 23rd Oct 2012, 02:54 PM -
[Selling] Mp3 Search Engine, File Host, SMS Script, Arcade Script, PDF Search Script, and More!
By Fileze in forum Completed TransactionsReplies: 12Last Post: 13th Mar 2012, 02:23 PM -
Greasemonkey script: Megaupload Premium Multifetch Script
By Dman in forum Webmaster ResourcesReplies: 46Last Post: 15th Dec 2011, 01:07 AM -
[Selling] Rslinkgens Premium link generator script V1 -Most advanced and viral script
By vccshopper in forum Completed TransactionsReplies: 0Last Post: 24th Jun 2011, 08:10 PM -
[Selling] A.A.S. (Adult Automated Script For ClipBucket Video Script)
By tangi in forum Completed TransactionsReplies: 0Last Post: 25th Mar 2011, 12:45 PM
themaLeecher - leech and manage...
Version 5.03 released. Open older version (or...