Jump to content

Panta

Members
  • Posts

    115
  • Joined

  • Last visited

Everything posted by Panta

  1. Please brothers i really need help on this, i have a script that populates from database, but my problem is that it will refresh for the records in the second selction box to occur and this makes the form in puts to drop, so i searched for way out and discovered i can achieve that with Ajax, but i have tried many scipts i found and none is working, am not good at ajax, so i decided to bring it forth for analysis. thanks these are my secipts, is meant to populate 3 drops down selection box. but it doesnt work ajax-dd3.php <!doctype html public "-//w3c//dtd html 3.2//en"><html><head><title></title><META NAME="DESCRIPTION" CONTENT=""><META NAME="KEYWORDS" CONTENT=""><script type="text/javascript">function ajaxFunction(choice){var httpxml;try { // Firefox, Opera 8.0+, Safari httpxml=new XMLHttpRequest(); }catch (e) { // Internet Explorer try { httpxml=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { httpxml=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } }function stateChanged() { if(httpxml.readyState==4) {//alert(httpxml.responseText);var myObject = JSON.parse(httpxml.responseText);for(j=document.myForm.state.options.length-1;j>=0;j--){document.myForm.state.remove(j);}var state1=myObject.value.state1;var optn = document.createElement("OPTION");optn.text = 'Select State';optn.value = '';document.myForm.state.options.add(optn);for (i=0;i<myObject.state.length;i++){var optn = document.createElement("OPTION");optn.text = myObject.state[i];optn.value = myObject.state[i];document.myForm.state.options.add(optn);if(optn.value==state1){var k= i+1;document.myForm.state.options[k].selected=true;}} //////////////////////////for(j=document.myForm.city.options.length-1;j>=0;j--){document.myForm.city.remove(j);}var city1=myObject.value.city1;//alert(city1);for (i=0;i<myObject.city.length;i++){var optn = document.createElement("OPTION");optn.text = myObject.city[i];optn.value = myObject.city[i];document.myForm.city.options.add(optn);if(optn.value==city1){document.myForm.city.options[i].selected=true;}} ///////////////////////////document.getElementById("txtHint").style.background='#00f040';document.getElementById("txtHint").innerHTML='done';//setTimeout("document.getElementById('txtHint').style.display='none'",3000) } }var url="ajax-dd3ck.php";var country=myForm.country.value;if(choice != 's1'){var state=myForm.state.value;var city=myForm.city.value;}else{var state='';var city='';}url=url+"?country="+country;url=url+"&state="+state;url=url+"&city="+city;url=url+"&id="+Math.random();myForm.st.value=state;//alert(url); document.getElementById("txtHint2").innerHTML=url;httpxml.onreadystatechange=stateChanged;httpxml.open("GET",url,true);httpxml.send(null); document.getElementById("txtHint").innerHTML="Please Wait....";document.getElementById("txtHint").style.background='#f1f1f1';}</script></head></head><body><div id="txtHint" style="width : 100px;background-color: #cccc33;">Message area</div><br><br><form name="myForm" action='ajax-dd3-details.php' method='post'><input type='hidden' name='st' value=0><table width=500><tr><td >Select Country<br><select name="country" id='s1' onchange="ajaxFunction('s1');"><option value=''>Select One</option><?Php//require "../include/z_db1.php";require "config.php";// connection to database $sql="select distinct country from student5 ";foreach ($dbo->query($sql) as $row) {echo "<option value=$row[country]>$row[country]</option>";}?></select></td><td ><select name="state" onchange="ajaxFunction('s2');"><option value=''>Select One</option></select></td><td ><select name="city" onchange="ajaxFunction('s3');"><option value=''>Select One</option></select></td></tr></tr><tr><td colspan=3><input type="submit" value='Submit'></td></tr></table></form><br><br><div id="txtHint2"></div></body></html> ajax-dd3ck.php <?Phprequire "config.php"; // connection detailserror_reporting(0);// With this no error reporting will be there///////////////////////////////////////////////////////////////////////////////////////$country=$_GET['country'];// //$country='IND'; // To check you can use this$state1=$_GET['state'];$city1=$_GET['city'];//$state1="Andhra Pradesh";///////////// Validate the inputs ////////////// Checking country variable ///if((strlen($country)) > 0 and (!ctype_alpha($country))){ echo "Data Error";exit;}// Checking state variable (with space ) ///if ((strlen($state1)) > 0 and ctype_alpha(str_replace(' ', '', $state1)) === false) {echo "Data Error";exit;}/////////// end of input validation //////if(strlen($country) > 0){$q_country="select distinct(state) from student5 where country = '$country'";}else{$q_country="select distinct(state) from student5";}//echo $q_country;$sth = $dbo->prepare($q_country);$sth->execute();$state = $sth->fetchAll(PDO::FETCH_COLUMN);$q_state="select distinct(city) from student5 where ";if(strlen($country) > 0){$q_state= $q_state . " country = '$country' ";}if(strlen($state1) > 0){$q_state= $q_state . " and state='$state1'";}$sth = $dbo->prepare($q_state);$sth->execute();$city = $sth->fetchAll(PDO::FETCH_COLUMN);$main = array('state'=>$state,'city'=>$city,'value'=>array("state1"=>"$state1","city1"=>"$city1"));echo json_encode($main); ////////////End of script /////////////////////////////////////////////////////////////////////////////////?> thanks
  2. ` <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
  3. Thanks so much justsomeguy it works perfect I fixed the last line resize_image(( 'source' => 'input.jpg', 'dest' => 'output.jpg', 'w' => 200, 'h' => 400));Much love bro rep+
  4. Thanks so much , I will try to incoprate it and will return with my feedback. Much love rep+
  5. 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>
  6. please i dont know what you mean by JSG break it down for me please
  7. $headers .= 'BCC: ' . implode(', ',$email_list) . "rn"; i have done that but at this line this is how i handled it, is it correct
  8. i tried to use the single one now but still cant send to gmail
  9. when i try to echo it nothing comes up, but yahoomails i have in the list do deliver just gmails that does not
  10. 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
  11. 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!"; }} } ?>
  12. 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!"; } } } ?>
  13. I will like to see the code you are using to redirect .cos with that your code you have not specified that you want to send mail.
  14. 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
  15. I have attached my code avat.txt
  16. 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
  17. Panta

    problem with login

    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
×
×
  • Create New...