Kentc3's Posts
Nairaland Forum › Kentc3's Profile › Kentc3's Posts
1 (of 1 pages)
Please, i need your help. I am new to jquery and am in need of it to achieve a task. Please help me out. Beow is a snippet of my code and what i intend to achieve below, after the snippet... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Untitled 1</title> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function (e) { $("#form" .on('submit',(function(e) {e.preventDefault(); //$("#result" .empty();//$('#loading').show(); $.ajax({ url: "show.php", // Url to which the request is send type: "POST", // Type of request to be send, called as method data: new FormData(this), // Data sent to server, a set of key/value pairs (i.e. form fields and values) contentType: false, // The content type used when sending data to the server. cache: false, // To unable request pages to be cached processData:false, // To send DOMDocument or non processed data file it is set to false success: function(data) // A function to be called if request succeeds { //$('#loading').hide(); $("#result" .html(data);} }); })); }); </script> </head> <body> <div id="table"> <div id="result" style="background-color:red; height:20px; width:200px;"></div> <form method="post" action="" id="form" enctype="multipart/form-data"> <table style="width: 100%"> <tr> <td style="height: 25px; width: 88px">Amount</td> <td style="height: 25px"> <input name="name" style="width: 161px; height: 29px" type="text" id="name" placeholder="Input amount" onchange/><br/> </td> </tr> <tr> <td style="height: 25px; width: 88px"> calculate</td> <td style="height: 25px"> <input name="Text1" type="text" id="calculate"/> </td> </tr> <tr> <td style="height: 25px; width: 88px"> </td> <td style="height: 25px"> <input name="pwd" type="text" placeholder="Name"/> </td> </tr> <tr> <td style="width: 88px; height: 30px;"> </td> <td style="height: 30px"> <input style="width: 99px; height: 41px" type="submit" value="Register" name="submit" /></td> </tr> </table> </form> </div> </body> </html> What i intend to achieve is: Once the value in amount field changes, it goes to a .php page, calculate and display the result as a value in another input field called calculate. When the submit button is pressed, it moves the form to show.php, store in database, and output the result... I have tried different methods, but am finding it difficult displaying the values in an input field. Please i need your help.. Thanks |
Good Morning all, please, i am trying to create a website that a user can buy and sell bitcoins from me. The issue is that am confuse on how to go about the creation. I was wondering if there is any third party site i can be referred to, which i can just incorporate into my site or better still if i can create it myself using blockchain API.. Please, i will love to know what your opinion are and how to achieve positive result.. Thanks |
if i be your father, i for pour the sperm way produce you for toilet...... anu ohia moderation2020: |
Guy, See as i dy laugh dy cry because of you!! Lol.....Very Funny Comment Indeed Tapout: |
Owk....how do i contact you please? JackOfAllTrades: |
Please, i will like to play videos on my site by generating it from my database.. the problem is that, i do not want to use html5 video tag to do that.. i want something sophisticated like video.js or jw player... but i do not know how to embed it on my webpage... can u help or show me where to get a video tutorial on that.. thanks |
Where can i find a tutorial on how to use the jwplayer or video.js Adesege: |
lalasticlala:hey!! Stop that, thats a lie.... I live close to WTC and enugu has been very calm so far..... |
Adesege:Owk... thank you very much, i will try it out... |
Good Day Guys, Please i will want to play videos on my website, but do not want to make use of the HTML5 Video tag to do that.... i tried using jw player but the process of setting up the ftp and embedding in my web page and so on, seems to be cumbersome.... please i will love someone to assist me with other ways of achieving this .... thanks. anticipating your replies. |
xyluz:Thank you very much, it is now working...... i remove the dirname, and moved the file to the directory straight, without changing the name of the file... SEE MY CHANGES BELOW I replaced this $newname=dirname().'/images1/'.$filename; if(!file_exists($newname)) { if((move_uploaded_file($_FILES['photo']['tmp_name'],$newname))) { with this below $newname='images1/'.$filename; if(!file_exists($newname)) { if((move_uploaded_file($_FILES['photo']['tmp_name'],$newname))) { And it is now working..... Thanks, i really appreciate |
xyluz:The issue remained the same.... i used the var_dump($me) as u said, and the image path was displayed.... the question now is, how do i rectify it coz i have tried all possible ways i know to no avail.... please help out.. i am getting error such as this array (size=4) 'sn' => string '11' (length=2) 'fname' => string 'll' (length=2) 'lname' => string 'll' (length=2) 'image' => string 'C:wampwwwimage.sample/images1/20141216_183233.jpg' (length=49) |
This code Uploads a picture into a database, but when i try to retrieve it and display it, the result is blank... i need you guys assistant on how to overcome this coz i ve been stuck here for weeks.. i will really appreciate it... Below is the Upload Script if(isset($_POST['submit'])) { $name=$_POST['name']; $email=$_POST['email']; $pic=$_FILES['photo']['name']; if((!empty($_FILES['photo'])) && ($_FILES['photo']['error']==0)) { $filename=basename($_FILES['photo']['name']); $ext= substr($filename, strrpos($filename,'.')+1); if(($ext == "jpg" || $ext == "gif" || $ext == "JPG" || $ext == "jpeg" || $ext == "JPEG" || $ext == "PNG" || $ext == "png" || $ext == "GIF" &&($_FILES['photo']['size']<100000000)){ $newname=dirname(__FILE__).'/images1/'.$filename; if(!file_exists($newname)) { if((move_uploaded_file($_FILES['photo']['tmp_name'],$newname))) { mysql_connect("Localhost","Gospel","gospel" or die("Could not connect" ;mysql_select_db("picture" or die("could not select db" ;$insert=mysql_query("INSERT INTO `pix`(`sn`, `fname`, `lname`, `image`) VALUES (NULL,'".$name."','".$email."','".$newname."')" or die("database not found" ;echo "<img src='$pic' alt='' height='300' width='500'>"."<br>"; echo "<img src='$newname' alt='' height='300' width='500'>"."<br>"; echo "its done! the file has been saved as:".$newname; } else { echo "Error! problem occured"; }} else { echo "error file:".$_FILES['photo']['name']."already exist"; }} else { echo "File format not supported"; }} else { echo "thank you, no file uploadedd"; } } BELOW IS THE RETRIEVE AND DISPLAY SCRIPT <?php mysql_connect("Localhost","Gospel","gospel" or die("Could not connect" ;mysql_select_db("picture" or die("could not select db" ;$select=mysql_query("SELECT * from `pix` WHERE sn= 23 " or die("could not find" ;if(mysql_num_rows($select)==true) { $me=mysql_fetch_array($select); ?> <img src="<?php echo $me['image']; ?>" alt="" height="200" width="120"> <?php } ?> Please i need a solution... Thanks |
1 (of 1 pages)
.on('submit',(function(e) {