Jump to content

Panta

Members
  • Content Count

    115
  • Joined

  • Last visited

Posts posted by Panta


  1. `   <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script><script>var maxwords = 250;//function check_length(obj, cnt, rem){    var ary = obj.value.split(" "); // doubled spaces will throw this off    var len = ary.length;    cnt.innerHTML = len;    rem.innerHTML = maxwords - len;    if (len > maxwords) {        alert("Message in '" + obj.name + "' limited to " + maxwords + " words.");        ary = ary.slice(0,maxwords-1);        obj.value = ary.join(" "); // truncate additional words        cnt.innerHTML = maxwords;        rem.innerHTML = 0;        return false;    }    return true;} </script>HTML   <textarea name="Message 1" onkeypress=" return check_length(this, document.getElementById('count1'), document.getElementById('remaining1'));"></textarea>Word count: <span id="count1">0</span>  Words remaining: <span id="remaining1">250</span><textarea name="Message 2" onkeypress=" return check_length(this, document.getElementById('count2'), document.getElementById('remaining2'));"></textarea>Word count: <span id="count2">0</span>  Words remaining: <span id="remaining2">500</span>

    please my problem is that i want the different textarea to work according to its limit, but i notice that both uses same word limit. your help will be appreciated. thanks in advance


  2. please i respect and appreciate this forum, am working on a project that needed people to upload picture which will go with a thumbnail, i have all that working but i really wish i could resize the picture to fixes Max. Height and a Max width, what i mean is that i want the pictures not to exceed some certin fixed height or weight. these are my codes all working fyn but i need help on how to fix the order. thanks as you input ur blessed efforts

    <?phpdefine('UPLOADED_IMAGE_DESTINATION', 'uploads/');define('PROCESSED_IMAGE_DESTINATION', 'logo/');function process_image_upload($Field){    $temp_file_path = $_FILES[$Field]['tmp_name'];    $temp_file_name = $_FILES[$Field]['name'];    list(, , $temp_type) = getimagesize($temp_file_path);    if ($temp_type === NULL) {        return false;    }    switch ($temp_type) {        case IMAGETYPE_GIF:            break;        case IMAGETYPE_JPEG:            break;        case IMAGETYPE_PNG:            break;        default:            return false;    }    $uploaded_file_path = UPLOADED_IMAGE_DESTINATION . $temp_file_name;    $processed_file_path = PROCESSED_IMAGE_DESTINATION . preg_replace('/.[^.]+$/', '.jpg', $temp_file_name);    move_uploaded_file($temp_file_path, $uploaded_file_path);    /*     * PARAMETER DESCRIPTION     * (1) SOURCE FILE PATH     * (2) OUTPUT FILE PATH     * (3) THE TEXT TO RENDER     * (4) FONT NAME -- MUST BE A *FILE* NAME     * (5) FONT SIZE IN POINTS     * (6) FONT COLOR AS A HEX STRING     * (7) OPACITY -- 0 TO 100     * (8) TEXT ANGLE -- 0 TO 360     * (9) TEXT ALIGNMENT CODE -- POSSIBLE VALUES ARE 11, 12, 13, 21, 22, 23, 31, 32, 33     */    $result = create_watermark_from_string(        $uploaded_file_path,        $processed_file_path,        'www.hirectory.com.',        'Arial.ttf',        40,        'CCCCCC',        75,        45,        22    );    if ($result === false) {        return false;    } else {        return array($uploaded_file_path, $processed_file_path);    }}/* * Here is how to call the function(s) */$result = process_image_upload('File1');if ($result === false) {    echo '<br>An error occurred during file processing.';} else {    echo '<br>Original image saved as <a href="' . $result[0] . '" target="_blank">' . $result[0] . '</a>';    echo '<br>Watermarked image saved as <a href="' . $result[1] . '" target="_blank">' . $result[1] . '</a>';}?><form action="" method="post" enctype="multipart/form-data">Select a file to upload for processing<br><input type="file" name="File1"><br><input type="submit" value="Submit File"></form>

  3. Every one of your header lines needs to end with rn. You have "r" in some places, and "rn", they all need to be "rn", and remove the extra line breaks. When you print headers you should see a list of the headers, one header per line, with no empty lines between them.

    $headers .= 'BCC: ' . implode(', ',$email_list) . "rn";

    i have done that but at this line this is how i handled it, is it correct


  4. What errors do you get when you comment-out error reporting?

    i dont have error but the problem is that on this line

    $headers .= 'BCC: ' . implode(', ',$email_list) . "rn"; 
    the emails i have in the $email_list only yahoomails do send but i will not see any in the gmail that i also have listed in $email_list. thank you

  5. please i have been working on a code that will help me send bulk mail to me subscribers, i tried to use BCC but i notice that it works for yahoomail, but does not work for gmail, it sends only to yahoomails in the list and will not send to gmail, please these are my codes i need help

    <?phperror_reporting(0);  if (isset($_POST['formType'])) {    if ($_POST['formType'] === "join_us") {// read the list of emails from the file.$email_list = file("elist.txt");// count how many emails there are.$total_emails = count($email_list);// go through the list and trim off the newline character.for ($counter=0; $counter<$total_emails; $counter++) {   $email_list[$counter] = trim($email_list[$counter]);   }// implode the list into a single variable, put commas in, apply as $to value.$to = "";// how to send an email with BCC$headers  = 'MIME-Version: 1.0' . "r";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "r";// this email may not exist$headers .= 'To: Website <noreply@website.com>' . "r";// this is a good email, that must exist (some user may send a reply)$headers .= 'From: Website <goodExistingEmail@website.com>' . "r";// mails to be delivered to$headers .= 'BCC: ' . implode(', ',$email_list) . "rn";$subject = "My email test.";$message = "Hello morrissing, how are you today bro?";if ( mail($to,$subject,$message, $headers) ) {   echo "The email has been sent!";   } else {   echo "The email has failed!";   }} } ?>

  6. please i have been working on a code that will help me send bulk mail to me subscribers, i tried to use BCC but i notice that it works for yahoomail, but does not work for gmail, it sends only to yahoomails in the list and will not send to gmail, please these are my codes i need help

    <?php
    error_reporting(0);
    if (isset($_POST['formType'])) {
    if ($_POST['formType'] === "join_us") {
    // read the list of emails from the file.
    $email_list = file("elist.txt");
    // count how many emails there are.
    $total_emails = count($email_list);
    // go through the list and trim off the newline character.
    for ($counter=0; $counter<$total_emails; $counter++) {
    $email_list[$counter] = trim($email_list[$counter]);
    }
    // implode the list into a single variable, put commas in, apply as $to value.
    $to = "";
    // how to send an email with BCC
    $headers = 'MIME-Version: 1.0' . "r
    ";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "r
    ";
    // this email may not exist
    $headers .= 'To: Website <noreply@website.com>' . "r
    ";
    // this is a good email, that must exist (some user may send a reply)
    $headers .= 'From: Website <goodExistingEmail@website.com>' . "r
    ";
    // mails to be delivered to
    $headers .= 'BCC: ' . implode(', ',$email_list) . "rn
    ";
    $subject = "My email test.";
    $message = "Hello morrissing, how are you today bro?";
    if ( mail($to,$subject,$message, $headers) ) {
    echo "The email has been sent!";
    } else {
    echo "The email has failed!";
    }
    } }
    ?>

  7. freedownlods.php <?php include('header.php') ;?> <div id="content"> <div class="post" id="post-12"> <h1 > Free Rendering Materials</h1> <div class="entry"> <div class="featured-image"> </div> <p class="url" > <p class="style3"> <strong>Revit</strong></p> <ol> <li> Click here to Download <a href="download.php?file=revit/79-ceilings-an-introduction-to-revit-ceilings.pdf">Revit Ceilings</a> </li> <li>Click here to Download <a href="download.php?file=revit/Revit_2011_to_ATL3_Win32.zip">Revit 2010 to Artlantics 3.0 plugin</a> </li> </li> </ol> <p class="style3"><strong> 3D max</strong></p> <ol> <li>Click here to Download <a href="">Max Cars</a></li> <li>Click here to Download <a href="">Max Tutorials</a> </li> </ol> <p class="style3"><strong> Shaders and Billboards</strong> </p> <ol> <li>Click here to Download <a href="">Raster Images</a> </li> <li>Click here to Download <a href="">Shaders</a></li> </ol> <p class="style3"><strong> Artlantics</strong></p> <ol> <li>Click here to Download <a href="download.php?file=artlantics/billboards.rar">Billboard and Shaders</a></li> <li>Click here to Download <a href="download.php?file=artlantics/artlantis_tutorial_script.pdf">Artlantics Tutorial</a></li> <li> Click here to Download <a href="">Artlantics Objects</a> </li> </ol> <strong style="color:#F00">Total</strong> <strong style="color:#F00">Site downloads <?php $fp=fopen("downloads.txt","r");$count=fgets($fp,1024);echo $count;?></strong><?php include('footer.php');?>End of freedownload.phpdownload.php$file_directory = "files"; //Name of the directory where all the sub directories and files exists$file = $_GET['file']; //Get the file from URL variable$file_array = explode('/', $file); //Try to seperate the folders and filename from the path$file_array_count = count($file_array); //Count the result$filename = $file_array[$file_array_count-1]; //Trace the filename$file_path = dirname(__FILE__).'/'.$file_directory.'/'.$file; //Set the file path w.r.t the download.php... It may be different for u.if(file_exists($file_path)) {header("Content-disposition: attachment; filename={$filename}"); //Tell the filename to the browser header('Content-type: application/octet-stream'); //Stream as a binary file! So it would force browser to download readfile($file_path); //Read and stream the file$site="freedownloads.php";include('count.php');//including download countsheader('Refresh: 2; URL='.$site);}else { echo "Sorry, the file does not exist! Please check the file in the directory";}}?>End of download.php


  8. Please am new with php and I just uploaded my first site and in that my site I do encounter two problems that I don't see when using my local server.the first one is the main problem is that I have some tutorials I wish that people can download.in my local server if I try to download it will. Downlod.but now on the live server if I try to downlod it will just display a lot of code on the page ,and these code will come with numbers and alphabet.I guess there is somtin I ve not done write.plz I need help so that materials can be downloaded.the site is http://avatconcepts.com.ng/freedownloads.php


  9. please am still new with php, i have a script that has been working well with my local server, but now i have uploaded it with my host.but my problem is that after registeration , when i try to login i will see an error message"Warning: Cannot modify header information - headers already sent by (output started at /home/avatconc/public_html/servicesdrawing.php:2) in /home/avatconc/public_html/libforall.php on line 94"please i dont know what to do , i need help.thanks


  10. this is my correction but i still ve problems

    <?php    	require('siteadmin.header.php');	include_once ("inc/auth.php");	include('checkadmin.php');	$auth= new auth();?>		<!-- CSS -->	<link rel="stylesheet" href="css/form.css" type="text/css" />		<!-- JavaScript -->	<script type="text/javascript" src="scripts/wufoo.js"></script>	<div id="container">		<div class="info">			<h2>Add New Item</h2>		</div>		<div>			<table border="0" cellpadding="0" cellspacing="0">				<tr>					<td><a href="adminindex.php"><img src="buttons/button1up.png" border="0" id="button1" vspace="1" hspace="1"></a><a href="items.php"><img src="buttons/button2up1.png" border="0" id="button2" vspace="1" hspace="1"></a><a href="purchase.php" ><img src="buttons/button3up1.png" border="0" id="button3" vspace="1" hspace="1"></a><a href="sales.php" ><img src="buttons/button4up1.png" border="0" id="button4" vspace="1" hspace="1"></a><a href="logout.php" ><img src="buttons/button5up1.png" border="0" id="button5" vspace="1" hspace="1"></a><br></td>				</tr>			</table>		</div>		<form id="form1" name="form1" class="wufoo " enctype="multipart/form-data" autocomplete="on"method="post" ><?php	if (isset($_POST['_submit_check'])){		$name = $_POST["name"];		$info = $_POST["info"];		$sn = $_POST["sn"];		$categorie = $_POST["categorie"];		$whouse =$_POST["whouse"];		$package = $_POST["packid"];		$cost = $_POST["cost"];		$insert= $_POST["fileName"];		$insert1= $_POST["fileNamea"];		 		$auth->connect();		if($sn == 0){		  ?>			<div align="center" style="border:2px solid red">				<b>enter serial number</b>			</div><?php		}		else {			$result = $auth->displaystock($sn,'sn');			$row = mysql_num_rows($result);			if($row > 0){?>			<div align="center" style="border:2px solid red">				<b>Item already defined</b>			</div>		<?php			}			else{				$query = "INSERT INTO stock (name,info,sn,categorie,package,cost,whouse ,  pix,  otherpix) VALUES ('$name', '$info ', '$sn', '$categorie','$package', '$cost','$whouse' ,'$insert', '$insert1')";?>			<div align="center" style="border:2px solid red">				<b>item inserted</b>			</div>	<?php				print "	\n\n\n";			} 		}	}?>			<div class="info">				<h4><a href="reportstock.php">Go To Report</a></h4>			</div>			<ul>				<li><?phpecho ' <input type="file" name="file[]" size="30" style="cursor:hand;"/> <br /> ';echo ' <input type="file" name="file[]" size="30" style="cursor:hand;"/> <br /> ';echo '<input type="submit" name="action" value="Upload" />'; 	if(isset($_POST['action']))	{	   	 $uploaddir = "../my/images/stockpix/";					$filename = $_FILES['file']['name'][0];			$filename1 = $_FILES['file']['name'][1];			$filetmp  = $_FILES['file']['tmp_name'][0];			$filetmp1 = $_FILES['file']['tmp_name'][1];			$filesize = $_FILES['file']['size'][0];			$filesize1 = $_FILES['file']['size'][1];			$filetype = $_FILES['file']['type'][0];			$filetype1 = $_FILES['file']['type'][1];			$ext = substr(strrchr($filename, "."),1);			$ext1 = substr(strrchr($filename1, "."),1);			$conf = $uploaddir . $filename;			$conf1 = $uploaddir . $filename1;			$filepath = $uploaddir . $filename;			$filepath1 = $uploaddir . $filename1;		if ($filename != "" && $filename1 != "")		{					if (!file_exists($filepath) && !file_exists($filepath1))			{				if ($ext == "jpg" || $ext == "gif" || $ext == "tiff" || $ext == "png" || $ext == "bmp" && $ext1 == "jpg" || $ext1 == "gif" || $ext1 == "tiff" || $ext1 == "png" || $ext1 == "bmp")				{					if($filesize < "500000"  && $filesize1 < "500000")					{						$upload = move_uploaded_file($filetmp, $filepath);						$upload1 = move_uploaded_file($filetmp1, $filepath1);						echo '<font color=blue>'. $filename . '   and	'. $filename1 . ' <i>was successfully uploaded...</font><br />';						}					else					{						echo '<font color=red>'.$filename . '   or	'. $filename1 . ' <i>greater than the maximum file size allowed...</font><br />';					}				}				else				{					echo '<font color=red>'. $filename . '   or	'. $filename1 . ' <i>is invalid file type...</font><br />';				}				}			else			{				echo $filename . '   or	'. $filename1 . ' <i>already exists...</i><br />';			}		} ?>					<img src = "<?php echo $filepath;?>" width="200" height="300">					<img src = "<?php echo $filepath1;?>" width="200" height="300"><?php	}	else {	 $filepath="none";		 $filepath1="none";	?>												<?php	}?><input type="text" readonly="" name="fileName" value="<?php if(isset($_POST['action']))	 {echo $filepath;} else echo "";?>" />	 <input type="text" readonly=""  name="fileNamea" value="<?php if(isset($_POST['action']))	 {echo $filepath1;} else echo '';?>" />				</li>				<li id="foli1"	 >					<label class="desc" >						Item					</label>					<div>						<input name="name" type="text" class="field text medium"	 maxlength="255" tabindex="1"/>					</div>				</li>					<li id="foli1" >					<label class="desc">						SN					</label>					<div>						<input  name="sn" type="text" class="field text medium" value="" maxlength="255" tabindex="2" />					</div>				</li>				<li id="foli3" >					<label class="desc" >						Description					</label>					<div>						<textarea  name="info" class="field textarea small" rows="10" cols="50"	tabindex="3"></textarea>					</div>				</li>				<li id="foli0" >					<label class="desc">						Appraised Value					</label>					<span class="symbol">$</span>					<span>						<input	 name="cost" type="text" class="field text currency" size="10" tabindex="4" />							<label for="Field0">Dollars</label>					</span>									</li>				<li id="foli6" >					<label class="desc"  for="Field6">						ware house					</label>					<div>						<input	 name="whouse" type="text" class="field text medium" maxlength="255"	 tabindex="5" />					</div>				</li>				<li id="foli7" >					<label class="desc">						Categorie					</label>					<div>						<select name="categorie"		 class="field select medium"		 tabindex="6" >													<option value="1" >								Mercedes							</option>							<option value="2" >								Mazda							</option>							<option value="3" >								Toyota							</option>							<option value="4" >								Camry							</option>							<option value="5" >								Nissian									</option>							<option value="6" >								Others							</option>													</select>					</div>				</li>				<li id="foli9">					<label class="desc" >						package?					</label>					<div class="col">						<input  name="packid" type="hidden" value="" />										<input	 name="packid" type="radio" class="field radio" value="1" tabindex="7" />						<label class="choice" for="Field9_0" >							unit						</label>											<input name="packid" type="radio" class="field radio" value="2" tabindex="8" />						<label class="choice" for="Field9_1" >							box						</label>											<input name="packid" type="radio" class="field radio" value="3" tabindex="9" />						<label class="choice" for="Field9_1" >							Kg						</label>																	</div>				</li>				<li class="buttons">					<input id="saveForm" class="btTxt submit"  type="submit"  name="add" value="Submit" tabindex="10" />					<input type="hidden" name="_submit_check" value="1"/>				</li>				<li style="display:none">					<label for="comment">Do Not Fill This Out</label>					<textarea name="comment" id="comment" rows="1" cols="1"></textarea>				</li>			</ul>						</form>	</div><!--container--><?php		require('siteadmin.footer.php');?>


  11. after uploading the pix and submiting the for i do get error massage saying" Notice: Undefined variable: filepath1 in C:\wamp\www\online_stoke\my\testing.php on line 53Notice: Undefined variable: filepath in C:\wamp\www\online_stoke\my\testing.php on line 53please can some one tell me where the problem is from these are my scripts<?php require('siteadmin.header.php'); include_once ("inc/auth.php"); include('checkadmin.php'); $auth= new auth();?> <!-- CSS --> <link rel="stylesheet" href="css/form.css" type="text/css" /> <!-- JavaScript --> <script type="text/javascript" src="scripts/wufoo.js"></script> <div id="container"> <div class="info"> <h2>Add New Item</h2> </div> <div> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td><a href="adminindex.php"><img src="buttons/button1up.png" border="0" id="button1" vspace="1" hspace="1"></a><a href="items.php"><img src="buttons/button2up1.png" border="0" id="button2" vspace="1" hspace="1"></a><a href="purchase.php" ><img src="buttons/button3up1.png" border="0" id="button3" vspace="1" hspace="1"></a><a href="sales.php" ><img src="buttons/button4up1.png" border="0" id="button4" vspace="1" hspace="1"></a><a href="logout.php" ><img src="buttons/button5up1.png" border="0" id="button5" vspace="1" hspace="1"></a><br></td> </tr> </table> </div> <form id="form1" name="form1" class="wufoo " enctype="multipart/form-data" autocomplete="on"method="post" ><?php if (isset($_POST['_submit_check'])){ $name = $_POST["name"]; $info = $_POST["info"]; $sn = $_POST["sn"]; $categorie = $_POST["categorie"]; $whouse =$_POST["whouse"]; $package = $_POST["packid"]; $cost = $_POST["cost"]; $auth->connect(); if($sn == 0){ ?> <div align="center" style="border:2px solid red"> <b>enter serial number</b> </div><?php } else { $result = $auth->displaystock($sn,'sn'); $row = mysql_num_rows($result); if($row > 0){?> <div align="center" style="border:2px solid red"> <b>Item already defined</b> </div> <?php } else{ $query = "INSERT INTO stock (name,info,sn,categorie,package,cost,whouse , pix, otherpix) VALUES ('$name', '$info ', '$sn', '$categorie','$package', '$cost','$whouse' ,'$filepath', '$$filepath1')";?> <div align="center" style="border:2px solid red"> <b>item inserted</b> </div> <?php print " \n\n\n"; } } }?> <div class="info"> <h4><a href="reportstock.php">Go To Report</a></h4> </div> <ul> <li><?phpecho ' <input type="file" name="file[]" size="30" style="cursor:hand;"/> <br /> ';echo ' <input type="file" name="file[]" size="30" style="cursor:hand;"/> <br /> ';echo '<input type="submit" name="action" value="Upload" />'; if(isset($_POST['action'])) { $uploaddir = "../my/images/stockpix/"; $filename = $_FILES['file']['name'][0]; $filename1 = $_FILES['file']['name'][1]; $filetmp = $_FILES['file']['tmp_name'][0]; $filetmp1 = $_FILES['file']['tmp_name'][1]; $filesize = $_FILES['file']['size'][0]; $filesize1 = $_FILES['file']['size'][1]; $filetype = $_FILES['file']['type'][0]; $filetype1 = $_FILES['file']['type'][1]; $ext = substr(strrchr($filename, "."),1); $ext1 = substr(strrchr($filename1, "."),1); $conf = $uploaddir . $filename; $conf1 = $uploaddir . $filename1; $filepath = $uploaddir . $filename; $filepath1 = $uploaddir . $filename1; if ($filename != "" && $filename1 != "") { if (!file_exists($filepath) && !file_exists($filepath1)) { if ($ext == "jpg" || $ext == "gif" || $ext == "tiff" || $ext == "png" || $ext == "bmp" && $ext1 == "jpg" || $ext1 == "gif" || $ext1 == "tiff" || $ext1 == "png" || $ext1 == "bmp") { if($filesize < "500000" && $filesize1 < "500000") { $upload = move_uploaded_file($filetmp, $filepath); $upload1 = move_uploaded_file($filetmp1, $filepath1); echo '<font color=blue>'. $filename . ' and '. $filename1 . ' <i>was successfully uploaded...</font><br />'; } else { echo '<font color=red>'.$filename . ' or '. $filename1 . ' <i>greater than the maximum file size allowed...</font><br />'; } } else { echo '<font color=red>'. $filename . ' or '. $filename1 . ' <i>is invalid file type...</font><br />'; } } else { echo $filename . ' or '. $filename1 . ' <i>already exists...</i><br />'; } } ?> <img src = "<?php echo $filepath;?>" width="200" height="300"> <img src = "<?php echo $filepath1;?>" width="200" height="300"><?php } else { $filepath="none"; $filepath1="none"; ?> <?php }?><input type="text" readonly="" name="fileName" value="<?php if(isset($_POST['action'])) {echo $filepath;} else echo "";?>" /> <input type="text" readonly="" name="fileNamea" value="<?php if(isset($_POST['action'])) {echo $filepath1;} else echo '';?>" /> </li> <li id="foli1" > <label class="desc" > Item </label> <div> <input name="name" type="text" class="field text medium" maxlength="255" tabindex="1"/> </div> </li> <li id="foli1" > <label class="desc"> SN </label> <div> <input name="sn" type="text" class="field text medium" value="" maxlength="255" tabindex="2" /> </div> </li> <li id="foli3" > <label class="desc" > Description </label> <div> <textarea name="info" class="field textarea small" rows="10" cols="50" tabindex="3"></textarea> </div> </li> <li id="foli0" > <label class="desc"> Appraised Value </label> <span class="symbol">$</span> <span> <input name="cost" type="text" class="field text currency" size="10" tabindex="4" /> <label for="Field0">Dollars</label> </span> </li> <li id="foli6" > <label class="desc" for="Field6"> ware house </label> <div> <input name="whouse" type="text" class="field text medium" maxlength="255" tabindex="5" /> </div> </li> <li id="foli7" > <label class="desc"> Categorie </label> <div> <select name="categorie" class="field select medium" tabindex="6" > <option value="1" > Mercedes </option> <option value="2" > Mazda </option> <option value="3" > Toyota </option> <option value="4" > Camry </option> <option value="5" > Nissian </option> <option value="6" > Others </option> </select> </div> </li> <li id="foli9"> <label class="desc" > package? </label> <div class="col"> <input name="packid" type="hidden" value="" /> <input name="packid" type="radio" class="field radio" value="1" tabindex="7" /> <label class="choice" for="Field9_0" > unit </label> <input name="packid" type="radio" class="field radio" value="2" tabindex="8" /> <label class="choice" for="Field9_1" > box </label> <input name="packid" type="radio" class="field radio" value="3" tabindex="9" /> <label class="choice" for="Field9_1" > Kg </label> </div> </li> <li class="buttons"> <input id="saveForm" class="btTxt submit" type="submit" name="add" value="Submit" tabindex="10" /> <input type="hidden" name="_submit_check" value="1"/> </li> <li style="display:none"> <label for="comment">Do Not Fill This Out</label> <textarea name="comment" id="comment" rows="1" cols="1"></textarea> </li> </ul> </form> </div><!--container--><?php require('siteadmin.footer.php');?>


  12. hello friends and my masters am still new with php , i was designing a site when i came across this problem. i want to upload 3 images to a file in my local server and i also want therir location to be in my table in the database.but the script i have is just for one file.please am just asking for help her my code<?phpfunction insertstock($name, $info, $sn, $categorie,$package, $cost,$whouse ,$filepath) { $query = "INSERT INTO stock (name,info,sn,categorie,package,cost,whouse , pix) VALUES ('$name', '$info ', '$sn', '$categorie','$package', '$cost','$whouse' ,'$filepath')"; $connection = mysql_connect(DBHOST, DBUSER, DBPASS) or die("Could not connect to database: " . mysql_error()); $SelectedDB = mysql_select_db(DBNAME); $result = mysql_query($query)or die(mysql_error()); } // end fonction?><form id="form1" name="form1" class="wufoo " enctype="multipart/form-data" autocomplete="on"method="POST" "><?php if (isset($_POST['_submit_check'])){ $name = $_POST["name"]; $info = $_POST["info"]; $sn = $_POST["sn"]; $categorie = $_POST["categorie"]; $whouse =$_POST["whouse"]; $package = $_POST["packid"]; $cost = $_POST["cost"]; $filepath=$_POST['fileName']; $auth->connect(); if($sn == 0){ ?> <div align="center" style="border:2px solid red"> <b>enter serial number</b> </div><?php } else { $result = $auth->displaystock($sn,'sn'); $row = mysql_num_rows($result); if($row > 0){?> <div align="center" style="border:2px solid red"> <b>Item already defined</b> </div> <?php } else{ $auth->insertstock($name, $info, $sn, $categorie,$package, $cost,$whouse ,$filepath);?> <div align="center" style="border:2px solid red"> <b>item inserted</b> </div> <?php print " \n\n\n"; } } }?> <div class="info"> <h4><a href="reportstock.php">Go To Report</a></h4> </div> <ul> <li><?phpecho ' <input type="file" name="file" size="30" style="cursor:hand;"/> <br /> ';echo '<input type="submit" name="action" value="Upload" />'; if(isset($_POST['action'])) { $uploaddir = "../my/images/stockpix/"; $filename = $_FILES['file']['name']; $filetmp = $_FILES['file']['tmp_name']; $filesize = $_FILES['file']['size']; $filetype = $_FILES['file']['type']; $ext = substr(strrchr($filename, "."),1); $conf = $uploaddir . $filename; $filepath = $uploaddir . $filename; if ($filename != "") { if (!file_exists($filepath)) { if ($ext == "jpg" || $ext == "gif" || $ext == "tiff" || $ext == "png" || $ext == "bmp") { if($filesize < "500000") { $upload = move_uploaded_file($filetmp, $filepath); echo '<font color=blue>'. $filename . ' <i>was successfully uploaded...</font><br />'; } else { echo '<font color=red>'.$filename . ' <i>greater than the maximum file size allowed...</font><br />'; } } else { echo '<font color=red>'. $filename . ' <i>is invalid file type...</font><br />'; } } else { echo $filename . ' <i>already exists...</i><br />'; } } ?> <input type="hidden" name="fileName" value="<?php echo $filepath; ?>"/> <img src = "<?php echo $filepath;?>" width="200" height="300"><?php } else { $filepath="none"; ?> <input type="hidden" name="fileName" value="<?php echo $filepath; ?>"/><?php }?> </li> <li id="foli1" > <label class="desc" > Item </label> <div> <input name="name" type="text" class="field text medium" maxlength="255" tabindex="1"/> </div> </li> <li id="foli1" > <label class="desc"> SN </label> <div> <input name="sn" type="text" class="field text medium" value="" maxlength="255" tabindex="2" /> </div> </li> <li id="foli3" > <label class="desc" > Description </label> <div> <textarea name="info" class="field textarea small" rows="10" cols="50" tabindex="3"></textarea> </div> </li> <li id="foli0" > <label class="desc"> Appraised Value </label> <span class="symbol">$</span> <span> <input name="cost" type="text" class="field text currency" size="10" tabindex="4" /> <label for="Field0">Dollars</label> </span> </li> <li id="foli6" > <label class="desc" for="Field6"> ware house </label> <div> <input name="whouse" type="text" class="field text medium" maxlength="255" tabindex="5" /> </div> </li> <li id="foli7" > <label class="desc"> Categorie </label> <div> <select name="categorie" class="field select medium" tabindex="6" > <option value="1" > Mercedes </option> <option value="2" > Mazda </option> <option value="3" > Toyota </option> <option value="4" > Camry </option> <option value="5" > Nissian </option> <option value="6" > Others </option> </select> </div> </li> <li id="foli9"> <label class="desc" > package? </label> <div class="col"> <input name="packid" type="hidden" value="" /> <input name="packid" type="radio" class="field radio" value="1" tabindex="7" /> <label class="choice" for="Field9_0" > unit </label> <input name="packid" type="radio" class="field radio" value="2" tabindex="8" /> <label class="choice" for="Field9_1" > box </label> <input name="packid" type="radio" class="field radio" value="3" tabindex="9" /> <label class="choice" for="Field9_1" > Kg </label> </div> </li> <li class="buttons"> <input id="saveForm" class="btTxt submit" type="submit" name="add" value="Submit" tabindex="10" /> <input type="hidden" name="_submit_check" value="1"/> </li> <li style="display:none"> <label for="comment">Do Not Fill This Out</label> <textarea name="comment" id="comment" rows="1" cols="1"></textarea> </li> </ul> </form> </div><!--container--><?php require('siteadmin.footer.php');?>


  13. please can anyone help me when trying to access some page on my new uploaded site but it keeps on displaying this erro message "Access denied for user '466844_panta1'@'%' to database 'user'"and this is the same user name that i use for login in to the database and the password is the password that i use for login in that i used at config.php which goes like this<?php$database_host = 'fdb2.host-ed.net';$database_user = '466844_panta1';$database_password = '*******';$database_name = 'user';$con = mysql_connect($database_host, $database_user, $database_password) or exit(mysql_error());mysql_select_db($database_name, $con) or exit (mysql_error());?>thanks help me out am a newbie


  14. This is two errors.1. You cannot send the session header because characters have already been output. This may be HTML that comes before the session_start function, it may be an echo statement, it may simply be an empty space or line break. All these are forbidden before you send a header.2. Something is wrong with mysql_select_db. When I try to duplicate the error message, I can do it only when the name of the database is incorrect. I suppose it is also possible that the DB exists, but 466844_panta1 is not a registered user of the database. I didn't try that. 466844_panta1 must have access to mysql (this allows mysql_connect to function correctly, which it seems to) AND to the 'user' database.
    thanks but i do login with 466844_panta1 and my password and that is what i'm using in my confg.php scriptthis is the config.php<?php$database_host = 'fdb2.host-ed.net';$database_user = '466844_panta1';$database_password = '*******';$database_name = 'user';$con = mysql_connect($database_host, $database_user, $database_password) or exit(mysql_error());mysql_select_db($database_name, $con) or exit (mysql_error());?>so please check if there is any erro .thanks

  15. please can anyone help me when trying to access some page on my new uploaded site it will display this erro message "Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /~/www/archansu.cz.cc/admin_page.php:2) in /~/www/archansu.cz.cc/admin_page.php on line 5Access denied for user '466844_panta1'@'%' to database 'user'"

×
×
  • Create New...