Jump to content

phpquery

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

phpquery's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hello friends, did you get a chance to look at my queries? Any resolutions to my queries. thanx, phpquery
  2. Hello, Please take a moment to look at the following codes. We are trying to create a user friendly editor & one of the features we are trying to add is the upload image functionality. Now we are able to upload one image ONLY. What we need is the ability to add multiple images. Attached are screen shots. In the screen shot named "front end_IMAGE" it shows that we have uploaded one image. Now i click on the Upload Image button again & the pop up for locating the image is shown which can be seen in screen shot named "upload_MORE_THAN_ONE_IMAGE"........If i now select the new image & click on upload> then i refresh the page > then the first image is deleted & second image is uploaded. So my issues are the following, 1) How do i resolve the issue where i can see the image as soon as it is uploaded. I dont want to refresh the page. It should automatically show in the front end as soon as i upload the image from a particular location. 2) How do i upload more than one images, without the first image getting deleted. CODE FOR screen shot named "front end_IMAGE" if(isset($_SESSION['img'])) { <?php session_start(); ?> <!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 http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="application/javascript"> function pt() { javascript:window.print(); } function find1() { javascript:window.find(); } </script> </head> <body> <FORM> <INPUT type="button" value="Upload Image" onClick="window.open('http://localhost/krishna/editor_trial/edt.php','mywindow','width=400,height=100,toolbar=no,location=no,status=no')"> </FORM> <FORM name="form1" action="" method="post"> <label> <p><textarea name="textarea" id="textarea" cols="70" rows="10" style="background-color:<?php echo "#".$_GET['cl']; ?>"><?php if(isset($_SESSION['img'])) { echo "<img src='".$_SESSION['img']."'/>"; } ?></textarea> </label> <p> <INPUT type="submit" value="Submit"> </FORM> [code=php:0] if(isset($_SESSION['img'])) { echo "<img src='".$_SESSION['img']."'/>"; } </body> </html> echo "<img src='".$_SESSION['img']."'/>"; } CODE FOR screen shot named "upload_MORE_THAN_ONE_IMAGE" <?php session_start(); ?> <!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 http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="application/javascript"> </script> </head> <body> <FORM ENCTYPE="multipart/form-data" ACTION="" METHOD="post"> <p> <label> <input name="userfile" type="file"> </label> <label> <input type="submit" name="file_uploaded" id="button" value="upload"/> </label> <br /> <br /> <INPUT type="button" value="OK" name="ok" onClick="window.close()"> </form> <?php if(isset($_POST['file_uploaded'])) { if (is_uploaded_file($_FILES['userfile']['tmp_name'])) { $file_realname = $_FILES['userfile']['name']; copy($_FILES['userfile']['tmp_name'], "E:/wamp/www/krishna/editor_trial/images/".trim($file_realname)); } $_SESSION['img']='images/'.$file_realname; } ?> </html> thanks in advance, php query [attachment deleted by admin]
  3. Hello, Thanks for your prompt response. Can you elaborate more on the response. I am not sure i understand. Do i need to make any edits to the codes? Thanks, phpquery
  4. Hello, Please have a look at the following codes & attached screen shots. When we enter details in the fields mentioned in the screen shot named "email_html" & click on OK then it gives me an error as shown in the screen shot named "email_validation_error" Codes for validator.php require_once 'SystemComponent.php'; class validator extends SystemComponent { var $errors; // A variable to store a list of error messages function validateNumber($theinput,$description = '') { if (is_numeric($theinput)) { return true; // The value is numeric, return true } else { $this->errors[] = $description; // Value not numeric! Add error description to list of errors return false; // Return false } } } Codes for email.php // Gather the data from the form, store it in variables $userEmail = $_POST['email']; $maxMessages = $_POST['maximum']; // Create a validator object require_once('validator.php'); $theValidator = new Validator(); // Validate the forms //$theValidator->validateNumber($userEmail, 'Email Address'); $theValidator->validateNumber($maxMessages, 'Maximum number of messages'); // Check whether the validator found any problems if ($theValidator->foundErrors()) { // The were errors, so report them to the user echo 'There was a problem with: '.$theValidator->listErrors('<br>'); // Show the errors, with a line between each } else { echo "All ok, so now add the user to the mailing list"; } Please guide me on a resolution to this query. Thanks in advance, phpquery [attachment deleted by admin]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.