kevin wood 29 Posting Whiz

SQL for dummies is a good book to start with the ISBN number is 0764501054 it might have a bit of an off putting name but it is clear and easy to understand; from this book she should be able gain a good understanding of how to use mysql and it does not get to technical for beginners.

this book helped me and a few of my friends while we where in uni just getting to grips with mysql. the more advanced books just take it that you already know the basics which is never good when you start out.

i could do with getting another copy of it i need to brush up on it myself.

kevin wood 29 Posting Whiz

what level of book is she look at getting a beginners guide or one for the experienced user of mysql.

kevin wood 29 Posting Whiz

i am trying created a table on the server called images and when i text to see if the table has been created i get the message table already exists. as i did not develop the rest o the site i thought a table might have been created already called images. i looked through the code and there was no table called images.

i renamed the table any way just for ease and i got the same message. no matter what i change the table name to it tells me the table has already been created.

why would this happen?

it only runs through the code once when this happens so it cannot be trying to create the same table twice?

kevin wood 29 Posting Whiz

i have never encounted a problem like this so i dont know if this is the correct place to ask the question as i am not sure if it is a development problem or a server problem.

I am developed a content management system and you can access the home page fine but when you try to log into the cms side it begins to go wrong.

after the password as been entered and the user should be directed to the next page it is dropping the www. in the url address and because of this it cannot find the page it is looking for.

how do i overcome this small silly problem.

kevin wood 29 Posting Whiz

solved thanks for all your help i felt like punching myself when i seen i did not echo the result.

kevin wood 29 Posting Whiz

just as i posted that last thread i realised that i had not echoed the result anywhere so it could never be displayed without this. i told you it would be something silly and i dont think it can get worse than that.

kevin wood 29 Posting Whiz

the record is meant to be displayed within a table on the homepage. i have changed the code now so that it no longer displayed the message something is in the database and just left the new select line in and still nothing is being displayed.

the code for the full page looks looke this

<body onload="MM_preloadImages('global/home_over.gif','global/refurbs_over.gif','global/setups_over.gif','global/contact_over.gif')">
<?php
include ('includes/db_inc.php');
?>
<table width="740" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td>&nbsp;</td>
        <td><img src="global/navTop.gif" width="370" height="60" /></td>
    </tr>
    <tr>
        <td><img src="global/logo.gif" alt="CMS Services" width="370" height="65" /></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td><a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','global/home_over.gif',1)"><img src="global/home_off.gif" alt="Home" name="home" width="370" height="17" border="0" id="home" /></a></td>
                </tr>
                <tr>
                    <td><a href="refurbishment/index.htm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('refurbs','','global/refurbs_over.gif',1)"><img src="global/refurbs_off.gif" alt="Refurbishment Projects" name="refurbs" width="370" height="15" border="0" id="refurbs" /></a></td>
                </tr>
                <tr>
                    <td><a href="setups/index.htm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('setups','','global/setups_over.gif',1)"><img src="global/setups_off.gif" alt="Set Ups &amp; Dismantles" name="setups" width="370" height="16" border="0" id="setups" /></a></td>
                </tr>
                <tr>
                    <td><a href="contact/index.htm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contact','','global/contact_over.gif',1)"><img src="global/contact_off.gif" alt="Contact CMS Services" name="contact" width="370" height="17" border="0" id="contact" /></a></td>
                </tr>
            </table></td>
    </tr>
    <tr>
        <td><img src="global/navSpacer.gif" width="10" height="20" /></td>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td><img src="images/img_home.jpg" width="370" height="160" /></td>
        <td><img src="images/header_home.gif" width="370" height="160" /></td>
    </tr>
</table>
<table width="740" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td width="185" bgcolor="#F1DECB"><table width="185" border="0" cellspacing="0" cellpadding="10">
            <tr>
                <td bgcolor="#002C54" class="textWhite">&nbsp;</td>
            </tr>
        </table></td>
        <td width="20">&nbsp;</td>
        <td width="535" background="global/pageBg.gif"><table width="95%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td>
					<?php
						
						$sql= "SELECT * FROM cms_core WHERE id= '1'";
						$query = mysql_query($sql);
						$result = mysql_fetch_array($query);
						
					?>								
				</td>
            </tr>
        </table></td>
    </tr>
</table>
<table width="740" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td><img src="global/footer.gif" width="740" height="70" /></td>
    </tr>
    <tr>
        <td><div align="center">
            <p class="footer">&copy; CMS Services. All rights reserved. …
kevin wood 29 Posting Whiz

what i want it to do is to display the save data on the page it is being recalled on as it is text for the homepage. it is being saved from an editor into the database and then should display on the pages the text is needed.

the problem is that it is saying that it is saving the data to the database but it will not display the data from the database. it will probably be something which is stupid stoping it from working as it usually is when it comes to code.

fresh eyes looking at it always helps.

kevin wood 29 Posting Whiz

the code for saving it to the database is

include ('../includes/db_inc.php');

// save content to db
if(isset($_POST["inpContent"])) 
	{
	
	$sContent=stripslashes($_POST['inpContent']); // remove slashes (/)	
	$sContent=ereg_replace("'","''",$sContent); // fix SQL
		
	$sql="UPDATE cms_core SET editorial='$sContent' WHERE id=$id";
	$query = mysql_query($sql);
	}

and the code i have used to recall the data from the database is

$SQL = "SELECT '$sContnet' FROM cms_core WHERE id= '1' ";
      $res = mysql_query($SQL,$db);
      if(mysql_num_rows($res) > 0){
      echo "There is something!";
      } else {
      echo "Nothing !";
      }
 echo $sql;

if you need anymore let me know.

kevin wood 29 Posting Whiz

i need the code to display the item being called for from the database if there is something in the database and i am using the select statement should it not display what is being call for. i will upload the code for the saving and accessing the database. will you need any more?

kevin wood 29 Posting Whiz

i just took the create table from the db set up page and i am now just left with the message


There is something!

kevin wood 29 Posting Whiz

i have changed the part of the code where it is asked to display the answer if there is something in the record set and changed the editorial to

$sContent

and it now says there is something and the message it leaves looks like this


There is something!CREATE TABLE cms_core ( editroial longblob id int )

why is the create table part showing up is this meant to?

kevin wood 29 Posting Whiz

i tried the code you just put up and it gives me the same reply as before telling me there is nothing the database.

how can this be when i test the save to data base and it says it is saving the data that is needed. the as the data is being saved to the database it is stored in a variable called $sContent should i use the variable name when recalling the data in stead of the column name?

i will try this i see what the result is.

kevin wood 29 Posting Whiz

i echoed the $sql on both the pages and on the page where the data is being recall it gave the


Nothing in recordset.CREATE TABLE cms_core ( editroial longblob id int )

and when i echoed the $sql on the page where it is saving it gave me


UPDATE cms_core SET editorial='

then all the text that is being saved to the database with

WHERE id=$id

after the text.

it looks like the data is being saved to the database but why can i not recall the data on the other page.

kevin wood 29 Posting Whiz

i have just edited the code used to recall the data so it looks like this and the error has gone it now tells me there is nothing in the record set.

the code looks like this

$SQL = "SELECT editorial FROM cms_core WHERE id= 1 ";
 $res = mysql_query( $SQL, $db )
 or die( "<br><br><b>MySQL
 Error:</b> " . mysql_errno() . " // " .
 mysql_error() . "<br><br>" );

 if( $res !== "" ) {
 echo "Nothing in recordset.";
 } else {
 echo "Something in recordset.";
 }
kevin wood 29 Posting Whiz

i am no getting a different problem with error codes. cmsservdb is the database cms_core is the table name and editorial is the coloum name. my database sewtup looks like this

<?php
$db = mysql_connect("xxxxxxxx","xxxxx","xxxx");
mysql_select_db("cmsservdb", $db);

// Create table in my_db database
mysql_select_db("cmsserdb");
$sql = "CREATE TABLE cme_core 
(
editroial longblob
)";
mysql_query($sql);

?>

and the error message i am getting now on the page that is recalling the data is

MySQL Error: 1146 // Table 'cmsservdb.editroial' doesn't exist

the code used to access this data is

$SQL = "SELECT * FROM editorial WHERE id= 1 ";
 $res = mysql_query( $SQL, $db )
 or die( "<br><br><b>MySQL
 Error:</b> " . mysql_errno() . " // " .
 mysql_error() . "<br><br>" );

 if( $res !== "" ) {
 echo "Nothing in recordset.";
 } else {
 echo "Something in recordset.";
 }
kevin wood 29 Posting Whiz

here is the full error message

MySQL Error: 1064 // You have an error in your SQL syntax near '' at line 1

kevin wood 29 Posting Whiz

why i am i getting this synyax error when trying to display data from the database

the code for saving the data is

// save content to db
if(isset($_POST["inpContent"])) 
	{
	
	$sContent=stripslashes($_POST['inpContent']); // remove slashes (/)	
	$sContent=ereg_replace("'","''",$sContent); // fix SQL
		
	$sql="UPDATE cms_core SET editorial='$sContent' WHERE id=$id";
	$query = mysql_query($sql);
	}

and the code to get the data from the data base is

$SQL = "SELECT cms_core FROM '$sContent' WHERE id=1";
 $res = mysql_query( $SQL, $db )
 or die( "<br><br><b>MySQL
 Error:</b> " . mysql_errno() . " // " .
 mysql_error() . "<br><br>" );

 if( $res !== "" ) {
 echo "Nothing in recordset.";
 } else {
 echo "Something in recordset.";
 }

thanks if anyone can help

kevin wood 29 Posting Whiz

the problem that i am experiencing is that the html editor is doing the editing side fine but it is then not updating the database with its new saved data so this cannot be recalled on to a different page. when i try to recall the data i have put if stsatement in it and it tells me that there is no data stored in the database. so i need the html editor to store the data into a database so i can recall it on to the new page

kevin wood 29 Posting Whiz

i have now got the first page accessing the database and trying to display the data but nothing was showing up. so i told the server to display a message if the database was empty and guess what it told me. that the database was empty.

so the problem now is saving the data to the database. it does not sound that hard to do but the fact that a wysiwyg editor is being used the code from that is throwing me off.

the code that is used to save the data to the database is this

// save content to db
         if(isset($_POST["inpContent"])) 
	{
	
	$sContent=stripslashes($_POST['inpContent']); // remove slashes (/)	
	$sContent=ereg_replace("'","''",$sContent); // fix SQL
		
	$sql="UPDATE cms_core SET editorial='$sContent' WHERE id=$id";
	$query = mysql_query($sql);
	}

the variables used in this code come from the wysiwyg editor and the code that uses looks like this

<form id="form1" name="form1" method="post" action="index.php?id=<?php echo $id; ?>">
	
			<!-- Embed RTE -->
			<script>
				var oEdit1 = new InnovaEditor("oEdit1");
		
				oEdit1.btnStyles = true;
				oEdit1.css = "../includes/styles.css";
		
				<!-- Set which buttons are active -->
				oEdit1.features = ["Undo","Redo","Save","XHTMLSource","|","Table","Hyperlink","Numbering","Bullets","|","StyleAndFormatting","Styles","ListFormatting","|","Bold","Italic","Underline"];
		
				oEdit1.btnSave= true; // Enable save button
				oEdit1.onSave = new Function("save()"); // Specify a function to call
		
				oEdit1.width = "500px"; // Set editor width
				oEdit1.height = "350px"; // Set editor height
		
				oEdit1.RENDER(document.getElementById("idTemporary").innerHTML);
			</script>
	
			<input type="hidden" name="inpContent" id="inpContent">
	
		</form>

this code loads the data into the editor and the save button should save the code but i dont think the save button is linked to the database the code for the save …

kevin wood 29 Posting Whiz

i am trying to recall data from my a database which someone else has set up. the site is a contnet management system and it uses innovaStudio which is a wysiwyg to do all the editing for the text on the website. the editor side of it works where it will load the text into the text area and the changes can be made to. from here there is then a save function which submits the body text from the form.

the save function looks like this

function save()
	{
	document.forms.form1.elements.inpContent.value = oEdit1.getHTMLBody();
	document.forms.form1.submit()
	}

the code which i think is not working is the saving the data back to the database as when i try to recall the information on a different page i get no connection errors but i do not get anything displaying.

the code he has used for the saving of the data back to the database is

if(isset($_POST["inpContent"])) 
	{
	
	$sContent=stripslashes($_POST['inpContent']); // remove slashes (/)	
	$sContent=ereg_replace("'","''",$sContent); // fix SQL
		
	$sql="UPDATE cms_core SET editorial='$sContent' WHERE id=$id";
	$query = mysql_query($sql);
	}

he has put code in for loading the text into the editor which looks like this

if(!$_GET["id"]){ $id = 1; }
$sql = "SELECT * FROM cms_core WHERE id=$id";
$query = mysql_query($sql);
$result = mysql_fetch_array($query);
$sContent = $result['editorial'];

it uses some code to load temporarily hold the data before loading it into the editor and the code for this is

<pre id="idTemporary" name="idTemporary" style="display:none">
<?  echo htmlentities($sContent); ?>
</pre>

the code …

kevin wood 29 Posting Whiz

I am trying to set up a database on the server and keep getting the same error message. it say to me that it was successful in connecting to the db but access is denied for the user. what is causing this as the password and user name that is being used has benn used before to connect to the server and create the databases.

kevin wood 29 Posting Whiz

i have once again been asked to fix some code on a website. this time the website is meant to have a content management system but once again the person who made the original website did not complete what he started.

the content management system side of it is using InnovaStudio wysiwyg html editor to edit the text on the pages. it looks good but the support and user guides for this may as well not exist they are that bad.

the code i need help with is as follows

// save content to db
if(isset($_POST["inpContent"])) 
	{
	
	$sContent=stripslashes($_POST['inpContent']); // remove slashes (/)	
	$sContent=ereg_replace("'","''",$sContent); // fix SQL
		
	$sql="UPDATE cms_core SET editorial='$sContent' WHERE id=$id";
	$query = mysql_query($sql);
	}
	
// load content
if(!$_GET["id"]){ $id = 1; }
$sql = "SELECT * FROM cms_core WHERE id=$id";
$query = mysql_query($sql);
$result = mysql_fetch_array($query);
$sContent = $result['editorial'];

?>

the page this code should be updating does not have any sql or connection to a db on it so i have entered

<?php
		if(!$_GET["id"]){ $id = 1; }
		$sql = "SELECT * FROM cms_core WHERE id=$id";
	        $query = mysql_query($sql);
		$result = mysql_fetch_array($query);
		$sContent = $result['editorial'];

	    ?>

the page is not displaying any of the edited text.

If any one has used innovastudio and could give me some help with using this then that would be great.

kevin wood 29 Posting Whiz

it is using the innovastudio WYSIWYG editor which i have never come across. if there is anyone who has used this before and could help please shed some light on the situation.

kevin wood 29 Posting Whiz

i have been asked to fix a problem on a content management system website. when the user edits the text and then clicks on the save button it is not updating the text on the pages selected. the code that is being used is

oEdit1.btnSave= true; // Enable save button
	    oEdit1.onSave = new Function("save()"); // Specify a function to call

and the function looks like this

<script>
function save()
	{
	document.forms.form1.elements.inpContent.value = oEdit1.getHTMLBody();
	document.forms.form1.submit()
	}
</script>

if anyone can help please get back

kevin wood 29 Posting Whiz

i have correct the few lines of code which were wrong but it is now saying that the table i have created does not exist. the code i have used to create the table is

include "db.php";

$con = mysql_pconnect("$dbhost","$dbusername","$dbpasswd") 
    or die ("QUERY ERROR: ".mysql_error());

$db = mysql_select_db("$database_name", $connection)
    or die("QUERY ERROR: ".mysql_error());

        // Create table in $database_name database
        mysql_select_db("$database_name", $connection);
            $sql = "CREATE TABLE images (imageID int NOT NULL AUTO_INCREMENT, Broad1 varchar(50), Broad2 varchar(50), Broad3 varhar(50))";

        mysql_query("INSERT INTO images (Broad1) VALUES ('$thumb_name')");

were have i gone wrong?

kevin wood 29 Posting Whiz

i am adding elements to my db and the elemtents which have been add will be displayed on a different page. i am using an upload page which creates a thumb nail of an uploaded image and then stores the path for this image in a variable called $thumb_name. the code i have used to enter the image into the db is

include "db.php";

$con = mysql_pconnect("$dbhost","$dbusername","$dbpasswd") 
	or die ("QUERY ERROR: ".mysql_error());

$db = mysql_select_db("$database_name", $connection)
	or die("QUERY ERROR: ".mysql_error());
			
		// Create table in $database_name database
		mysql_select_db("$database_name", $connection);
			$sql = "CREATE TABLE images 
				(imageID int NOT NULL AUTO_INCREMENT, Broad1 varchar(50), Broad2 varchar(50), Broad3 varhar(50))";

		mysql_query("INSERT INTO images (Broad1) VALUES ('$thumb_name')");
?>

and the code to display the image on the next page looks like this

<?php
				include"db.php";

				$result = mysql_query("SELECT * FROM images WHERE 'Broad1'='$thumb_name'");
  					{
  					echo $row['Broad1'];
  					echo "<br />";
					}
			?>
kevin wood 29 Posting Whiz

all the passwords and connection details will be changed this is only for testing purposes. thank you for the reply is was helpful.

kevin wood 29 Posting Whiz

i have changed 2 typo's in the code in the $conn = mysql_connect($dbhost, $dbuser, $dbpass)

$dbuser= $dbusername

$dbpass= $dbpasswd

kevin wood 29 Posting Whiz

i have just spotted a typo and i am just getting could not connect now

kevin wood 29 Posting Whiz

here is the db.php code

<?php


$dbhost = 'www.acmeart.co.uk';
$dbusername = 'acmeart';
$dbpasswd = 'all0wn01';
$database_name = 'acmeartdb';
$sitepath = "http://www.acmeart.co.uk/mercury/";
$sitename = "Mercury Email Distribution System";
$adminemail = "mercury@acmeart.co.uk";


$connection = mysql_pconnect("$dbhost","$dbusername","$dbpasswd")
or die ("Couldn't connect to server.");


$db = mysql_select_db("$database_name", $connection)
or die("Couldn't select database.");
?>

here is the code i am using to connect to the db.

<?php


include "db.php";


$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die     line 168
("QUERY ERROR: ".mysql_error());


$db = mysql_select_db("$database_name", $connection)
or die("QUERY ERROR: ".mysql_error());


// Create table in my_db database
mysql_select_db("$database_name", $connection);
$sql = "CREATE TABLE images
(
imageID int NOT NULL AUTO_INCREMENT,
Broad1 varchar(50),
Broad2 varchar(50),
Broad3 varhar(50)
)";


if (!$con)
{
die('Could not connect: ' . mysql_error());
}


mysql_select_db("$database_name", $con);


mysql_query("INSERT INTO image (Broad1)
VALUES ('$thumb_name')");


mysql_query($sql,$con);


mysql_close($con);


?>

i keep getting the error

(Using password: NO) in /home/acmeart/public_html/mercury/upload.php on line 168 QUERY ERROR: i have labelled line 168 for you

kevin wood 29 Posting Whiz

i have now tried to connect to my database which is set up on the server and i keep getting could not connect. i have db.php page which sets up the database and recall this by using include db.php

kevin wood 29 Posting Whiz

i am trying to connect to my database which i have set up and i keep getting the same message 'could not connect'.

i have a php page which sets up the database, and i recall this page with the include db.php to connect to the server.

i have tried using "QUERY ERROR: ".mysql_error()); to get the error back and it is still just saying 'could not connect'.

kevin wood 29 Posting Whiz

i have created an image upload page in my web site which stores the images on the server using php. i now need to get the images to display on a different page. here is the code i have used to set a variable to the file directory

// the new thumbnail image will be placed in images/thumbs/ folder
$thumb_name='image/thumbs/thumb_'.$image_name;
// call the function that will create the thumbnail. The function will get as parameters
//the image name, the thumbnail name and the width and height desired for the thumbnail
$thumb=make_thumb($newname,$thumb_name,WIDTH,HEIGHT);
}} }}

i now need to be able to display the uploaded in=mages on a different page for the user to be able to view what they have uploaded. i have got the images to show a preview on the first page by using this code

if(isset($_POST) && !$errors)
{
echo "<h5>Thumbnail created Successfully!</h5>";
echo '<img src="'.$thumb_name.'">';
}

?>

i thought i would be able to use img src line of code to display the images on a different page but this has not worked. I know this is probably the wrong wat hence the reason i am not getting the images displayed.

it would be much appreciated if someone could help me out with this code. this is all need to fix for the site to be finished and uploaded. i have tried to research this myself but have had no joy.

kevin wood 29 Posting Whiz

I have created a image upload for the site i am working on i now want the uer to be able to click on a preview button and this takes them to a separate page where they can see the images that have been uploaded.

for this to happen would i have to send a query to the database to retrieve the information or can i simply display them using the variable name which was set for the images.

kevin wood 29 Posting Whiz

i worked it out using iframes thanks for the reply tho.

kevin wood 29 Posting Whiz

i have solved this problem with thanks to the pointers from dangerdev. to fix the problem i took the form off the page where the user was being asked to upload the image and put it on to the upload.php page.

i then just created an iframe with dimensions added to it and said set the src to upload.php. as the submit button was on this page and was activated within the iframe it stops the page the user is on being reloaded thus stopping the entered information being lost. the code i used for the iframe is here.

<iframe name="uploadframe" src="upload.php" width="400" height="150" frameborder="0"></iframe>

this now just looks like it is part of the page it is on and the user would be none the wiser iframes are being used.

kevin wood 29 Posting Whiz

hello i am trying to get uploaded to a server using a hidden iframe so the page does not reload.

i have a upload.php page which resizes the file and remanes the file. What i thiink should happen is that the php file should be in the iframe and the submit button directs the information to this page. without the page reloading. the code i have keeps reloading the page which is not good.

the code i am using for the form is here

<form action="" enctype="multipart/form-data" method="post" target="target_upload">
<iframe id='target_upload' name='target_upload' src='upload.php' style='width:1px;height:1px;border:0'></iframe><input type="hidden" name="MAX_FILE_SIZE" value="1000000" />
<label>Select File: </label>
<div>
<input id="upload" name="upload" size="30" type="file">

<input type="submit" value="Upload File">
</form>

can anyone show me where i have gone wrong because this code keeps reloadiing my page which is not what is meant to happen.

kevin wood 29 Posting Whiz

the page still reloaded on me. does the action="upload.php" sent the from to the upload page or does the iframe stop this from happening.

kevin wood 29 Posting Whiz

the src for the iframe is the php page that resizes and renames the uploaded images. all uploaded images need to be passed through this page so they have the correct dimensions for the next section of the site.

i have changed the code so i now have an action="upload.php" and left the src as " ".

i will upload the files to the server.

kevin wood 29 Posting Whiz

here is the code i am using

1. <form name="uploader" method="POST" target="hidden_form" enctype="multipart/form-data">
2. <input type="hidden" name="MAX_FILE_SIZE" value="1000000">
3. <input type="file" name="upload_file">
4. <input name="submit" type="submit" value="Upload">
</form>
5. <iframe name="hidden_form" src="upload.php" height="0" width="0"></iframe>

kevin wood 29 Posting Whiz

i have now started t use the iframe method you pointed me in the direction of. i have set this up but the page is reloading. could this be fixed by using the javascript onClick to submit the form to the iframe file.

kevin wood 29 Posting Whiz

so should i not use the ext.ajax.request and use an iframe instead?

I have now gone down this route but have kept all my other code in case it is needed. my submit button now looks like this

with the upload.php being exicuted in the hidden iframe. i will test this and let you no how i get on thanks for the help.

kevin wood 29 Posting Whiz

thank you for the help. i have read through the tutorial and have come up with this

<script type="text/javascript">
function ajaxFunction()
{
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
      document.myForm.time.value=xmlHttp.responseText;
      }
    }
  xmlHttp.open("GET","response",true);
  xmlHttp.send(null);
  }
</script>
<form name="newad" method="post" enctype="multipart/form-data"  action="">
<input type="file"

<input type="file" name="image" ><input type="button" VALUE="Upload Image" onClick="ajaxFunction()”>
</form>

i have changed some of the lines to fit in with how i want it to work. i changed this line

xmlHttp.open("GET","response",true);

from

xmlHttp.open("GET","time.asp",true);

the reason being that the i do not need the time to be displayed and i am uploading files to the server. as i am uploading images is it possible to add some code to make sure that the file is an image with the correct file extension and resize the image to the correct dimensions.

I already have the code for this but it is done in php. the code i have got takes the file checks to see if it is an image then resizes the file and gives it a new name for it to be recalled on another page. the it looks like this but i dont think it will be of any use

 //define a maxim size for the …
kevin wood 29 Posting Whiz

i am not using the ExtJS application i have looked at using the Ext.Ajax.Request but i thought that it had to be used in conjunction with ExtJS application. Where can i find out how to write my own function to handle the ajax

kevin wood 29 Posting Whiz

i am working on a file upload system and i need the user to be able to upload images onto the server with the page reloading. the page reloading causes all the other information to be lost and the user having a lot of unwanted windows open.

what is the best way forward to complete this task?

kevin wood 29 Posting Whiz

I am fixing an e-mailing system using php and mysql and have hit a stumbling block. i have recently had to take on someone elses work and have fixed most of the problems they had created. I need to upload images and then display them on the newsletters that will be sent out.

the forms for entering the text and images must not be reloaded when the image is uploaded as all the entered information is not carried across to the new page. the code i am having trouble with is the upload side the page continues to be reloaded and all information is lost.

is there anyone who has successfully got this to work who could point me in the right direction.
is Ext.Ajax.request the best way for this or XMLHTTPRequest?