Question

Object does not support this property or method

Asked by: ecross102301

I am having a couple of issues getting a realtime interface built. I need help in getting a file upload added to my Jquery code that is parsed. And then displaying the image real-time so it can be positioned on the canvas.
One of my functions that controls the canvas is breaking with an error :
Line: 208
Error: Object doesn't support this property or method

Where the error breaks is on the $.ajax function please advise....

<?php
 
define("THIS_PAGE", "store_index");
 
include('admin/config.php');
include('templates/header.php');
 
$cardbg = $_POST["cardbg"];
echo "<input type=hidden name='cardbg' value=".$cardbg;">";
echo $cardbg;
?>
<?php
echo $_POST["cardbg"];
 
$url = $_GET["url"];
 
//echo '<pre>';
//echo htmlspecialchars(print_r($_POST, true));
//echo '</pre>';
 
$font = realpath('./fonts/');
putenv('GDFONTPATH='.$font);
 
$cardbg = $_POST["cardbg"];
echo $cardbg;
 
$_POST[cardbg] = $_POST["cardbg"];
 
//once the submit button has been clicked
if(isset($_POST["cardbg"])) {
        $cardbg = $_POST["cardbg"];
        header('Location: http://192.168.221.128/dvrg04222009/store/?card_id=$cardbg'); //the page to redirect to
}
 
 elseif($_POST["cardbg"] == "") {
        $cardbg = "";
        header('_$GET["url"]);//Location: http://192.168.221.128/dvrg04222009/edstore/design.php');
}
 
?>
 
 
<input type="hidden" id="cardbg" name="cardbg" value='<?php echo $_POST["cardbg"]; ?>'></input>
 
<style>
* {
padding : 0px;
margin : 0px;
}
 
.box {
        position: absolute;
        height: 98px;
        width: 98px;
        background: #CCF;
        border: 1px solid #AAD;
        text-align: center;
        font-size: 10px;
        }
 
.handle {
        cursor: move;
        }
 
html, body {
font-family : verdana;
}
 
#container2 {
border : 1 px solid blue;
width : 500px;
margin : 0px auto;
}
 
#canvas {
border : 1px solid black;
height : 300px;
width : 500px;
}
 
#toolbar {
border : 1px solid black;
border-bottom : 0px;
height : 150px;
width : 100%;
background : lightgray;
}
 
.object {
display : table;
clear : both;
	border : 1px dashed transparent;
}
 
.selected {
	border : 1px dashed black;
}
 
ul#icons {margin: 0; padding: 0; position : relative; top : -37px; float : right;}
ul#icons li {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left;  list-style: none;}
ul#icons span.ui-icon {float: left; margin: 0 4px;}
 
 
#tb_fontcolor {
	position: relative;
	width: 36px;
	height: 36px;
	background: url(images/select.png);
}
#tb_fontcolor div {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 30px;
	height: 30px;
	background: url(images/select.png) center;
}
 
.progressBox {
  width: 10em;
        height: 1em;
        position: relative;
        float: right;
        background: #cccccc;
 
.progressBar {
  width: 0;
  height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        background: #00df00;
}
 
.fileToUpload {
  float: right;
  margin-right: .5em;
}
 
/* Style for IFRAME */
.loader {
  border: 0;
  height: 0;
  width: 0;
  padding: 0;
  position: absolute;
  visibility: hidden;
}
 
</style>
 
<link rel="stylesheet" href="jquery-ui-1.7.1.custom.css" type="text/css"></link>
<link rel="stylesheet" href="css/colorpicker.css" type="text/css" />
 
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.7.1.custom.min.js"></script>
<script type="text/javascript" src="js/jquery.selectboxes.min.js"></script>
<script type="text/javascript" src="js/jquery.checkboxes.min.js"></script>
<script type="text/javascript" src="js/colorpicker.js"></script>
<script type="text/javascript" src="js/eye.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/layout.js?ver=1.0.2"></script>
 
<script type="text/javascript">
<!--
	var card_id = gup('card_id');
	var card_img = './'+card_id+'.png';
	var card_xml = 'cards/'+card_id+'.xml';
	document.write (card_xml);
	//var card_xml = "cards/0000001.xml";
	var canvas_width = 500;
	var canvas_height = 300;
 
	var timeout = undefined;
 
	function gup( name ) {
		name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
		var regexS = "[\\?&]"+name+"=([^&#]*)";
		var regex = new RegExp( regexS );
		var results = regex.exec( window.location.href );
		if( results == null )
			return "";
		else
			return results[1];
	}
 
		var cbloadcard = function() {
		$.ajax({
			type: "GET",
			url: card_xml,
			dataType: "xml",
			success: function(xml) {
 
				var $bg = $(xml).find('card').attr('background');
				$("#canvas").css("background-image", "url(\'cardbg/" + $bg + "\')");
 
				$(xml).find('object[type=text]').each(function(i){
					var content = $(this).find('content').text();
					var color = $(this).find('color').text();
					var size = $(this).find('size').text();
					var font = $(this).find('font').text();
					var bold = $(this).find('font').attr('bold');
					var italic = $(this).find('font').attr('italic');
 
					var top = $(this).find('top').text() / 100 * 300;
					var left = $(this).find('left').text() / 100 * 500;
					//var image = $(this).find('image').attr('src');
 
 
					$('<span id="obj_'+i+'" class="object"></span>')
						.attr("cb_content",content)
						.attr("cb_color",color)
						.attr("cb_size",size)
						.attr("cb_font",font)
						.attr("cb_bold",bold)
						.attr("cb_italic",italic)
						.attr("cb_type","text")
						.css({'position' : 'relative', 'top' : top, 'left' : left})
						.appendTo('#canvas');
 
					imageFromObject($('#obj_'+i));
 
				});
				cbinit();
			}
		});
}
 
 
	var cbinit = function() {
 
		$(".object").draggable({ containment: '#canvas', scroll: false, cursor: 'crosshair', grid: [5, 5], opacity: 0.35 });
 
	    // trigger a select on click
		$(".object").click(function () {
			$("#tb_object").selectOptions($(this).attr("id"));
			$(".object").removeClass("selected");
			$(this).addClass("selected");
 
			$('#tb_fontcolor div').css('backgroundColor', '#' + $(this).attr("cb_color"));
			$('#tb_fontcolor').ColorPickerSetColor($(this).attr("cb_color"));
			$("#tb_size").selectOptions($(this).attr("cb_size"));
			$("#tb_font").selectOptions($(this).attr("cb_font"));
 
			$("#tb_bold, #tb_italic").attr('checked', false);
 
			if ($(this).attr("cb_bold") == 'true') $("#tb_bold").attr('checked', true);
			if ($(this).attr("cb_italic") == 'true') $("#tb_italic").attr('checked', true);
 
			$("#tb_content").val($(this).attr("cb_content"));
 
		});
 
		// trigger click on drag
		$('.object').bind('dragstart', function(event, ui) {
			$(this).click();
		});
 
		$('.object').bind('dragstop', function(event, ui) {
			xmlOut();
		});
 
		// load objects in select box
		populateObjectSelector();
		// click first object
		$("#canvas").children().eq("0").click();
 
		/*
		CHANGE TRIGGERS
		*/
 
		$("#tb_object").change(function () { $("#tb_object option:selected").each(function () { $("#"+$(this).val()).click(); }); });
		$("#tb_font").change(function () { imageFromObject($('.selected').attr('cb_font',$('#tb_font option:selected').val())); });
		$("#tb_bold").change(function () { if ($('#tb_bold').attr('checked')) { imageFromObject($('.selected').attr('cb_bold','true')); } else { imageFromObject($('.selected').attr('cb_bold','false')); } });
		$("#tb_italic").change(function () { if ($('#tb_italic').attr('checked')) { imageFromObject($('.selected').attr('cb_italic','true')); } else { imageFromObject($('.selected').attr('cb_italic','false')); } });
		$("#tb_size").change(function () { imageFromObject($('.selected').attr('cb_size',$('#tb_size option:selected').val())); });
		$("#tb_content").bind('keyup', function() { clearTimeout(timeout); timeout = setTimeout(function() { imageFromObject($('.selected').attr('cb_content',$('#tb_content').val())); }, 500); });
 
		/*
		INITIALIZE COLOR PICJER
		*/
 
		$('#tb_fontcolor').ColorPicker({
			onShow: function (colpkr) { $(colpkr).fadeIn(500); return false; },
			onHide: function (colpkr) { $(colpkr).fadeOut(500); return false; },
			onChange: function (hsb, hex, rgb) {
				$('#tb_fontcolor div').css('backgroundColor', '#' + hex);
				clearTimeout(timeout);
				timeout = setTimeout(function() { imageFromObject($('.selected').attr('cb_color',hex)); }, 1000);
			}
		});
	};
 
	var imageFromObject = function(obj) {
		var font = $(obj).attr('cb_font');
		if ($(obj).attr('cb_bold') == 'true') font = font + '_Bold';
		if ($(obj).attr('cb_italic') == 'true') font = font + '_Italic';
		var imgurl = 'generator/file.drawtext2.php?'
					+"text='"+$(obj).attr('cb_content')
					+"'&amp;"
					+"font='"+'fonts/'+font+'.ttf'
					+"'&amp;"
					+"color=0x"+$(obj).attr('cb_color')
					+"&amp;"
					+"size="+$(obj).attr('cb_size')
					+"&amp;"
					+"type=png"
					+"&amp;"
					+"palette=256"
					+"&amp;"
					+"antialias=1"
					;
		$(obj).html('<img src="'+imgurl+'" />');
		xmlOut();
	}
 
	var px2pct = function(px,total) {
		px = px.substr(0,px.length-2);
		return Math.round(px / total * 100);
	}
 
	var xmlOut = function() {
		$("#xml_out").val('');
		var xml = '';
		xml = xml+'<card>'+"\n\t"+'<objects>'+"\n";
		$("#canvas").children().each(function (i) {
			xml = xml+'		<object type="'+$(this).attr("cb_type")+'">'+"\n";
			xml = xml+'			<content>'+$(this).attr("cb_content")+'</content>'+"\n";
			xml = xml+'			<size>'+$(this).attr("cb_size")+'</size>'+"\n";
			xml = xml+'			<color>'+$(this).attr("cb_color")+'</color>'+"\n";
			xml = xml+'			<font bold="'+$(this).attr("cb_bold")+'" italic="'+$(this).attr("cb_italic")+'">'+$(this).attr("cb_font")+'</font>'+"\n";
			xml = xml+'			<top>'+px2pct($(this).css("top"),canvas_height)+'</top>'+"\n";
			xml = xml+'			<left>'+px2pct($(this).css("left"),canvas_width)+'</left>'+"\n";
			xml = xml+'		</object>'+"\n";
		});
		xml = xml+"\t"+'</objects>'+"\n"+'</card>'+"\n";
		$("#xml_out").val(xml);
	};
 
 
	var populateObjectSelector = function() {
		$("#tb_object").removeOption(/./);
		$("#canvas").children().each(function (i) {
			$("#tb_object").addOption($(this).attr("id"), $(this).attr("id"));
		});
	};
 
	$(document).ready(function () {
		cbloadcard();
	});
 
// -->
 
 
 
 
// Micox Upload Script 2
<!--
function micoxUpload2(form,timeout,loading,callback){
/**
* micoxUpload2 - Submete um form para um iframe oculto e pega o resultado. Consequentemente pode
*               ser usado pra fazer upload de arquivos de forma assíncrona.
* Versão: 2.0 - 02/01/2008
* Autor: Micox - www.elmicox.com - elmicox.blogspot.com
* Licença: Creative Commons - http://creativecommons.org/licenses/by/2.5/br/
* Some Rights Reserved - http://creativecommons.org/licenses/by/2.5/
**/
 
        var $gE, addEvent, removeEvent, periodic, loadAnim, loaded, abortFrame; //small functions
        var error_prog = []; //errors by programer
        var new_form, loading_msg, loadpos=0; //the new form that will replace old form AND loading msg
        var z, old_action, concat, timeload, timecounter=0, iframe, name;
        var loads = ['&nbsp;&nbsp;&nbsp;','.&nbsp;&nbsp;','..&nbsp;','...']; //loading animation
 
        /*** small functions */
        $gE = function(quem){ return document.getElementById(quem) }
        addEvent = function(obj, evType, fn){
                if (obj.addEventListener){ obj.addEventListener(evType, fn, true) ; }
                if (obj.attachEvent) { obj.attachEvent("on"+evType, fn);}
        }
        removeEvent = function( obj, type, fn ) {
                if ( obj.detachEvent ) { obj.detachEvent( 'on'+type, fn ); }
                if ( obj.removeEventListener ) { obj.removeEventListener( type, fn, false ); }
        }
        loadAnim = function(){ //get animation of array loads
                if(loading.indexOf('<img')<0){ // 3 dots just if no image
                        if(loadpos>loads.length - 1){ loadpos = 0; }
                        return loads[loadpos++] + ' ';
                }else{ return '';}
        }
        periodic = function(){
                timecounter++ ;
if(timecounter/2 > timeout && timeout > 0){ //timeout expired (timeout = 0 is infinite)
                        clearInterval(timeload); //fim do contador
                        abortFrame(name);
                        loaded('timeout');
                }
                loading_msg.innerHTML = loading + ' ' + loadAnim();
        }
        abortFrame = function(o_frame){ //stop iframe
                var o_frame = typeof(o_frame)=="string" ? $gE(o_frame):o_frame;
                if(!o_frame){ return false; }
                try{ o_frame.contentWindow.stop(); //FF e OP
                }catch(e){
                        try{ o_frame.contentWindow.document.execCommand('stop');//IE
                        } catch(e){     o_frame.src = ''; /* tenta parar mermo */ }
                }
        }
        cloneEvents = function(source2,target,recursive){
                for(var p in source2){ //all params
                        try{if(source2[p].constructor==Function){
                                        target[p] = source2[p]
                        }}catch(e){}
                }
                if(recursive){
                        for(var el=0; el<source2.childNodes.length; el++){
                                var elem = source2.childNodes[el]
                                var elem_target = target.childNodes[el]
                                if(elem.nodeType==1){
                                        cloneEvents(elem,elem_target);
                                }
                        }
                }
        }
 
 
        //testing callback
if(typeof(callback)!='function'){ error_prog.push("The 'callback' parameter must be a function") }
 
        //testing if 'form' is a html object or a id string
        form = typeof(form)=="string" ? $gE(form):form;
        if(form.nodeName.toUpperCase()!='FORM'){
                error_prog.push("The first parameter must be a form element ID or a form element reference") }
 
        //testing if form have some input file
        var input_file = false;
        var infile = form.getElementsByTagName('input')
        for(z in infile){
                if(infile[z].type=='file'){
                        if(infile[z].value==''){
                                alert("The input is empty. I cant upload this.")
                                return true;
                        }else{
                                input_file = infile[z];
                        }
                }
        }
        if(input_file==false){ error_prog.push("The form must be a input type file") }
 
        //exit if programmer errors
        if(error_prog.length>0) {
                alert("Error in parameters of micoxUpload:\n\n" + error_prog.join('\n'));
                /* uncoment this if you want use try-catch-throw
                throw(error_prog.join('\n'))
                return true;    */
        }
 
        //random id for multiple calls
        rand = (m=Math).round( 20 * m.random() );
 
 //adding callback function to global scope
        //window['micoxCallbackTemp' + rand] = callback
 
        //creating the iframe
        name = "micox-temp" + rand;
        iframe = document.createElement("iframe");
        iframe.setAttribute("id",name);
        iframe.setAttribute("name",name);
        iframe.setAttribute("width","0");
        iframe.setAttribute("height","0");
        iframe.setAttribute("border","0");
        iframe.setAttribute("style","width: 0; height: 0; border: none;");
        //add to document
        form.parentNode.appendChild(iframe);
        window.frames[name].name = name; //ie sucks
 
        //event after load
        loaded = function(){
                //var iframe2 = $gE(name);
                clearInterval(timeload); //fim do contador
                //first, removing the event of iframe
                removeEvent(iframe,'load',loaded)
                //removind loading msg
                loading_msg.parentNode.removeChild(loading_msg);
                //removing old form
                //form.parentNode.removeChild(form);
 
                //calling callback with the return
                if(arguments[0]!='timeout'){
                        callback(iframe.contentWindow.document.body.innerHTML);
                }else{
                        callback('Timeout expired. ' + timeout + ' secs.');
                }
 
                //removing old iframe
                abortFrame(iframe);
                iframe.src=''; //to stop 'loadind' in FF. bug.
 
	iframe.parentNode.removeChild(iframe);
                delete iframe;
        }
        //adding the event
        addEvent(iframe,'load',loaded)
 
        //properties of form to a normal upload
        form.setAttribute("target",name);
        form.setAttribute("method","post");
        form.setAttribute("enctype","multipart/form-data");
        form.setAttribute("encoding","multipart/form-data");
        //aditional information if micoxUpload
        old_action = form.action;
        if(form.action.indexOf('?')>1){ concat = '' } else { concat = '?' }
        //form.setAttribute("action",form.action + concat + 'micoxUpload=1');
	form.setAttribute("action",form.action + concat + '');
 
        //submit
        form.submit();
 
        //make loading
	loading_msg = document.createElement('div');
        loading_msg.innerHTML = loading;
        form.parentNode.insertBefore(loading_msg,form);
        //making new form and hidden old form
        input_file.value='';
        form.reset();
        new_form = form.cloneNode(true);
        cloneEvents(form,new_form,true);
        new_form.reset();
        new_form.action = old_action;
        form.style.display = 'none';
        form.parentNode.insertBefore(new_form,form);
        //if you want new input file before the 'loading div', use this above (invert the comment)
        //form.parentNode.insertBefore(new_form,loading_msg);
 
        timeload = setInterval(periodic,500);
 
        //no submit default
        return false;
}
 
//-->
 
</script>
 <?php
          if(isset($_SERVER["PHP_SELF"])){
		    $url = $_SERVER['REQUEST_URI']; 
			//echo $url;
            $cardbg = $_POST["cardbg"];
            //echo('var bg = $_POST["cardbg"];');
                }
          ?>
 
<form action="<?php echo $url;?>/bizcard3.php" id='form_up3' method=post>
 
<?php
 
// Build Font List
$fonts = array();
foreach (glob("generator/fonts/*.ttf") as $filename) {
	$path_parts = pathinfo($filename);
	$fontname = str_replace('_Bold','',str_replace('_Italic','',str_replace('.ttf','',$path_parts['basename'])));
	if (!in_array($fontname,$fonts)) $fonts[] = $fontname;
}
//print_r(pathinfo($filename));
//print_r($fonts);
?>
 
<div id="body">
	<div id="body_container">
		<div id="container2">
			<!--<h1>--><font size=3><b>Card Builder</b></font><!--</h1>-->
			<div id="toolbar">
				Object : <select id="tb_object"></select><br />
 
				Font : <select id="tb_font"><?php foreach ($fonts as $font) echo "<option value='$font'>$font</option>"; ?></select>
<!--<?php echo $font;?>-->
				Size : <select id="tb_size"><?php for($i=7; $i<=42; $i++) echo "<option value='$i'>$i</option>"; ?></select>
				Bold : <input id="tb_bold" type="checkbox">
				Italic : <input id="tb_italic" type="checkbox"><br />
 
				Color : <div id="tb_fontcolor"><div style="background-color: #000000"></div></div>
					     <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
					<?//php include('ajaxfileupload.php');?>
					<?//php include('upload_tester2.php');?>
          
		  <?php
          if(isset($_SERVER["PHP_SELF"])){
          
		$cardbg = $_POST["cardbg"]; 
	    //echo('var bg = $_POST["cardbg"];'); 
		}
 
          ?>
 
<script type="text/javascript">
       		//function end_upload3(data){
			//ge = document.getElementById('returnUp');
			//ge.style.display = "block";
			//ge.innerHTML = returnUp;
	//document.getElementById('returnUp').innerHTML += returnUp + data;
			//alert(data);
		//}
		function end_upload3(data){
  		var ge = document.getElementById('returnUp');
		  if (ge) {
		    ge.style.display = "block";
		    ge.innerHTML = data;
		  }
		}  
	</script>
Logo:&nbsp;&nbsp;  
<input type='file' name='name_1' onchange="micoxUpload2(this.form,0,'<img src=\'load.gif\' /> Loading...',end_upload3)" />
 
<div id='returnUp' name='returnUp'><br />
</div>
 
 
 
<div style="position:absolute; top: 279px; left: 580px;">
<br><br>Text :&nbsp;&nbsp; <input id="tb_content" />
</div>
	<ul id="icons" class="ui-widget ui-helper-clearfix">
	<li class="ui-state-default ui-corner-all" title=".ui-icon-circle-plus"><span id="tb_addtext" class="ui-icon ui-icon-circle-plus">Add New</span></li>
				</ul>
			</div>
 
			<div id="canvas"></div>
			
<?php
if ($_FILES["name_1"]["name"] != "") {
 
// This is the form processing to upload the file
$filename = $_FILES["name_1"]["name"];
echo "<input type='hidden' name='name_1' id='name_1' value='$name_1;'>";
 
if ((($_FILES["name_1"]["type"] == "image/gif")
|| ($_FILES["name_1"]["type"] == "image/jpeg")
|| ($_FILES["name_1"]["type"] == "image/pjpeg")
|| ($_FILES["name_1"]["type"] == "image/x-png"))
&& ($_FILES["name_1"]["size"] < 20000))
	
	{
  if ($_FILES["name_1"]["name"]["error"] > 0)
    {
    echo "Return Code: " . $_FILES["name_1"]["name"]["error"] . "<br />";
    }
  else
    {
    	//This line assigns a random number to a variable. You could also use a timestamp here if you prefer.
        $ran = rand () ;
 
        //This takes the random number (or timestamp) you generated and adds a . on the end, so it is ready of the file extension to be appended.
        $ran2 = $ran.".";
 
        //This assigns the subdirectory you want to save into... make sure it exists!
        $target = "./upload/";
        //This combines the directory, the random file name, and the extension
        $target = $target . $ran2.$ext;
 
     move_uploaded_file($_FILES["name_1"]["tmp_name"],"./upload/" . $_FILES["name_1"]["name"]);
     echo "Upload: " . $_FILES["name_1"]["name"] . "<br />";
     echo "Type: " . $_FILES["name_1"]["type"] . "<br />";
     echo "Size: " . ($_FILES["name_1"]["size"] / 1024) . " Kb<br />";
	
	}
    	 //This line assigns a random number to a variable. You could also use a timestamp here if you prefer.
        $ran = rand () ;
 
        //This takes the random number (or timestamp) you generated and adds a . on the end, so it is ready of the file extension to be appended.
        $ran2 = $ran.".";
 
        //This assigns the subdirectory you want to save into... make sure it exists!
        $target = "./upload/";
        //This combines the directory, the random file name, and the extension
        $target = $target . $ran2.$ext;
 
     if(move_uploaded_file($_FILES["name_1"]["tmp_name"], $target))
        {
        echo "The file has been uploaded as ".$ran2.$ext;
 
    echo "Upload: " . $_FILES["name_1"]["name"] . "<br />";
    echo "Type: " . $_FILES["name_1"]["type"] . "<br />";
    echo "Size: " . ($_FILES["name_1"]["size"] / 1024) . " Kb<br />";
    move_uploaded_file($_FILES["name_1"]["tmp_name"],"./upload/" . $_FILES["name_1"]["name"]);
 
     }
    if (file_exists("./upload/" . $_FILES["name_1"]["name"]))
      {
      echo $_FILES["name_1"]["name"] . " already exists. ";
 
        //This function separates the extension from the rest of the file name and returns it
        $filename = $_FILES["name_1"]["name"];
        function findexts ($filename)
        {
        $filename = strtolower($filename) ;
        $exts = split("[/\\.]", $filename) ;
        $n = count($exts)-1;
        $exts = $exts[$n];
        return $exts;
        }
 
 //This applies the function to our file
        $ext = findexts ($_FILES["name_1"]["name"]);
 
        //This line assigns a random number to a variable. You could also use a timestamp here if you prefer.
        $ran = rand () ;
 
        //This takes the random number (or timestamp) you generated and adds a . on the end, so it is ready of the file extension to be appended.
        $ran2 = $ran.".";
 
        //This assigns the subdirectory you want to save into... make sure it exists!
        $target = "./upload/";
        //This combines the directory, the random file name, and the extension
        $target = $target . $ran2.$ext;
 
        move_uploaded_file($_FILES["name_1"]["tmp_name"],"./upload/" . $_FILES["name_1"]["tmp_name"]);
 
 if(move_uploaded_file($_FILES["name_1"]["tmp_name"], "./upload/"))
        {
        echo "The file has been uploaded as ".$ran2.$ext;
        }
      }
    else
      {
      move_uploaded_file($_FILES["name_1"]["tmp_name"],
      "upload/" . $_FILES["name_1"]["name"]);
      }
    }
  }
 
if (isset($_FILES["name_1"]["name"])) {
        $fileToUpload = $_FILES["name_1"]["name"];
        echo $fileToUpload;
}
?>
<!--<script type="text/javascript">-->
	
<div class="drag"><img class="drag" src="upload/<?php echo $name_1 ;?>"></div>
 
             <pre id="debug"></pre>
             <script language="JavaScript" type="text/javascript">
             <!--
 
             // this is simply a shortcut for the eyes and fingers
                function $(id)
                {
                        return document.getElementById(id);
                }
 
                var _startX = 0;                        // mouse starting positions
                var _startY = 0;
                var _offsetX = 0;                       // current element offset
                var _offsetY = 0;
                var _dragElement; // needs to be passed from OnMouseDown to OnMouseMove
                var _oldZIndex = 0;  // we temporarily increase the z-index during drag
                var _debug = $('debug');        // makes life easier
 
 InitDragDrop();
 
                function InitDragDrop()
                {
                        document.onmousedown = OnMouseDown;
                        document.onmouseup = OnMouseUp;
                }
 
                function OnMouseDown(e)
                {
                        // IE is retarded and doesn't pass the event object
                        if (e == null)
                                e = window.event;
                // IE uses srcElement, others use target
                        var target = e.target != null ? e.target : e.srcElement;
 
                        _debug.innerHTML = target.className == 'drag'
                                ? 'draggable element clicked'
                                : 'NON-draggable element clicked';
 
                        // for IE, left click == 1
                        // for Firefox, left click == 0
                        if ((e.button == 1 && window.event != null ||
                                e.button == 0) &&
                                target.className == 'drag')
                        {
                                // grab the mouse position
                                _startX = e.clientX;
                                _startY = e.clientY;
 
                                // grab the clicked element's position
                                _offsetX = ExtractNumber(target.style.left);
                                _offsetY = ExtractNumber(target.style.top);
 
                  // bring the clicked element to the front while it is being dragged
                                _oldZIndex = target.style.zIndex;
                                target.style.zIndex = 10000;
 
                                // we need to access the element in OnMouseMove
                                _dragElement = target;
 
                          // tell our code to start moving the element with the mouse
                                document.onmousemove = OnMouseMove;
 
                                // cancel out any text selections
                                document.body.focus();
				// prevent text selection in IE
                                document.onselectstart = function () { return false; };
                                // prevent IE from trying to drag an image
                                target.ondragstart = function() { return false; };
 
                                // prevent text selection (except IE)
                                return false;
                        }
                }
 
                function ExtractNumber(value)
                {
                        var n = parseInt(value);
 
                        return n == null || isNaN(n) ? 0 : n;
                }
 
                function OnMouseMove(e)
                {
                        if (e == null)
                                var e = window.event;
 
                        // this is the actual \"drag code\"
                        _dragElement.style.left = (_offsetX + e.clientX - _startX) + 'px';
                        _dragElement.style.top = (_offsetY + e.clientY - _startY) + 'px';
 
                        _debug.innerHTML = '(' + _dragElement.style.left + ', ' + _dragElement.style.top + ')';
                }
 
                function OnMouseUp(e)
                {
                        if (_dragElement != null)
                        {
                                _dragElement.style.zIndex = _oldZIndex;
 
                             // we're done with these events until the next OnMouseDown
                                document.onmousemove = null;
                                document.onselectstart = null;
                                _dragElement.ondragstart = null;
 
                                // this is how we know we're not dragging
                                _dragElement = null;
 
                               //_debug.innerHTML = 'mouse up';
 }
                }
                        </script>
 
 
			<textarea id="xml_out" cols="60" rows="15" style="display : none;"></textarea>
</div>
 
</div>
 
</div>
 
<div style="position: absolute; left: 800px; top: 635px;"><input type="image" src="../edstore/images/next.png" width="50"></div>
 
</form>
 
<?php
include('templates/footer.php');
?>

                                  
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361:
362:
363:
364:
365:
366:
367:
368:
369:
370:
371:
372:
373:
374:
375:
376:
377:
378:
379:
380:
381:
382:
383:
384:
385:
386:
387:
388:
389:
390:
391:
392:
393:
394:
395:
396:
397:
398:
399:
400:
401:
402:
403:
404:
405:
406:
407:
408:
409:
410:
411:
412:
413:
414:
415:
416:
417:
418:
419:
420:
421:
422:
423:
424:
425:
426:
427:
428:
429:
430:
431:
432:
433:
434:
435:
436:
437:
438:
439:
440:
441:
442:
443:
444:
445:
446:
447:
448:
449:
450:
451:
452:
453:
454:
455:
456:
457:
458:
459:
460:
461:
462:
463:
464:
465:
466:
467:
468:
469:
470:
471:
472:
473:
474:
475:
476:
477:
478:
479:
480:
481:
482:
483:
484:
485:
486:
487:
488:
489:
490:
491:
492:
493:
494:
495:
496:
497:
498:
499:
500:
501:
502:
503:
504:
505:
506:
507:
508:
509:
510:
511:
512:
513:
514:
515:
516:
517:
518:
519:
520:
521:
522:
523:
524:
525:
526:
527:
528:
529:
530:
531:
532:
533:
534:
535:
536:
537:
538:
539:
540:
541:
542:
543:
544:
545:
546:
547:
548:
549:
550:
551:
552:
553:
554:
555:
556:
557:
558:
559:
560:
561:
562:
563:
564:
565:
566:
567:
568:
569:
570:
571:
572:
573:
574:
575:
576:
577:
578:
579:
580:
581:
582:
583:
584:
585:
586:
587:
588:
589:
590:
591:
592:
593:
594:
595:
596:
597:
598:
599:
600:
601:
602:
603:
604:
605:
606:
607:
608:
609:
610:
611:
612:
613:
614:
615:
616:
617:
618:
619:
620:
621:
622:
623:
624:
625:
626:
627:
628:
629:
630:
631:
632:
633:
634:
635:
636:
637:
638:
639:
640:
641:
642:
643:
644:
645:
646:
647:
648:
649:
650:
651:
652:
653:
654:
655:
656:
657:
658:
659:
660:
661:
662:
663:
664:
665:
666:
667:
668:
669:
670:
671:
672:
673:
674:
675:
676:
677:
678:
679:
680:
681:
682:
683:
684:
685:
686:
687:
688:
689:
690:
691:
692:
693:
694:
695:
696:
697:
698:
699:
700:
701:
702:
703:
704:
705:
706:
707:
708:
709:
710:
711:
712:
713:
714:
715:
716:
717:
718:
719:
720:
721:
722:
723:
724:
725:
726:
727:
728:
729:
730:
731:
732:
733:
734:
735:
736:
737:
738:
739:
740:
741:
742:
743:
744:
745:
746:
747:
748:
749:
750:
751:
752:
753:
754:
755:
756:
757:
758:
759:
760:
761:
762:
763:
764:
765:
766:
767:
768:
769:
770:
771:
772:
773:
774:
775:
776:
777:
778:
779:
780:
781:
782:
783:
784:
785:
786:
787:
788:
789:
790:
791:
792:
793:
794:
795:
796:
797:
798:
799:
800:
801:
802:
803:
804:
805:
806:
807:
808:
809:
810:
811:
812:
813:
814:
815:
816:
817:
818:
819:
820:
821:
822:
823:
824:
825:
826:
827:
828:
829:
830:
831:
832:
833:
834:
835:
836:
837:
838:
839:
840:
841:
842:
843:
844:
845:
846:
847:
848:
849:
850:
851:
852:
853:
854:
855:
856:
857:
858:
859:
860:
861:
862:
863:
864:
865:
866:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-06-15 at 07:27:30ID24492269
Tags

PHP

,

Jquey

,

Javascript

Topics

JScript

,

Asynchronous Javascript and XML (AJAX)

,

Jquery

Participating Experts
1
Points
500
Comments
12

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. TEdit with Canvas
    Hi. I need a TEdit control with a canvas property. Any ideas how I can do this? Stu.
  2. Publishing Canvas Property
    I'm back, This should not be a very hard one, I tried to create a very simple new component based on the TPanel, the only thing I want to do is to publish its Canvas property, like this: type TImageCollection = class(TPanel) private { Private declarations } protec...
  3. Canvas in function
    Hello everybody! Can somebody tell me why I can't call Canvas in a function or procedure?: function Something(x,y:integer):boolean; begin Canvas.Moveto(x,y); end;
  4. Canvas in c#
    Is there any Canvas for drawing in c#?

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: mplungjanPosted on 2009-06-15 at 22:51:48ID: 24635133

Please post the view-source since that is where we can see what line 208 is.


 

by: ecross102301Posted on 2009-06-15 at 23:58:23ID: 24635405

<?xml version="1.0" encoding="utf-8"?>
<!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>
		<title>
		__|||| Digital Vision Resources Group&reg;  ||||__ Store		</title>
		
		<meta name="robots" content="FOLLOW,INDEX" />
		<meta name="abstract" content="DVRG is a PCI Certifified Card Embossing, Plastic Card Printer, Manufacturing and Distribution company. DVRG prints Brochures, Business Cards, Ad Slicks, Letterheads, Paper or Plastic? Either Way We'll Print It!&reg;" />
		<meta name="keywords" content="overland park printer, brochure, business card, plastic card printer, overland park ks printer, printing, gift cards, plastic card printing, membership cards, ID cards, printing in Kansas City area, embossed cards, cards in kc area, plastic cards in op area, direct mail in kansas city area, kc printing, kansas city printing, kc printer, kansas city printer, direct mail printer, printing services, kansas city printing services, printer service, kc printer service, business printer, business printing, dvrg printing services, dvrg, dvrg.com, high end printing, marketing materials, marketing material printers, mailing services, full service mailing, mailing and fulfillment services, dvrg solutions, credit card printing, gift card printing, marketing communication, concept to design printer, digital print, digital printers, digital printing, digital printing services, digital printer services, card program management, card program development, document solutions, cooperative direct mail programs" />
		<meta name="description" content="Your source for plastic card printing and embossing. Complete personalization, encoding and embossing. Print marketing materials, card carriers, brochures. Paper or Plastic? Either way we'll print it!" />
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="y_key" content="ce25f6da698e4ba8" />
		<!-- CSS -->
		<link rel="stylesheet" href="../css/style.css" type="text/css" /link>
		<!--[if IE]>
		<link rel="stylesheet" type="text/css" href="../css/ie.css" /link>
		<![endif]--> 
		
 
		
		<link type="text/css" href="css/smoothness/jquery-ui-1.7.1.custom.css" rel="stylesheet" /link>
		<link rel="stylesheet" href="css/colorpicker.css" type="text/css" /link>
	
		<script type="text/javascript" src="http://192.168.221.128/dvrg04222009/store/js/jquery-1.3.2.min.js"></script>
		<script type="text/javascript" src="http://192.168.221.128/dvrg04222009/store/js/jquery-ui-1.7.1.custom.min.js"></script>
		<script type="text/javascript" src="http://192.168.221.128/dvrg04222009/store/js/jquery.selectboxes.min.js"></script>
		<script type="text/javascript" src="http://192.168.221.128/dvrg04222009/store/js/jquery.checkboxes.min.js"></script>
		<script type="text/javascript" src="http://192.168.221.128/dvrg04222009/store/js/colorpicker.js"></script>
		<script type="text/javascript" src="http://192.168.221.128/dvrg04222009/store/js/eye.js"></script>
		<script type="text/javascript" src="http://192.168.221.128/dvrg04222009/store/js/utils.js"></script>
		<script type="text/javascript" src="http://192.168.221.128/dvrg04222009/store/js/layout.js?ver=1.0.2"></script>		
		
	</head>
	<body class="
	
	basic">
	
	
 
<div id="container">
	<div id="header">
		<div id="topbar">
			<ul>
				<li id="topbar_samples"><a href="request_samples.php"></a></li>
				<li id="topbar_files"><a href="upload_files.php"></a></li>
				<li id="topbar_cart"><a href="store.php"></a></li>
			</ul>
		</div>
		<div id="navbar">
			<div id="logo"><img src="../images/logo.png" width="267" height="100" alt="DVRG : Digital Vision Resource Group" /></div>
			<div id="menu">
				<ul>
					<li id="menu_home"><a href="../index.php"></a></li>
					<li id="menu_loyalty"><a href="../loyalty.php"></a></li>
					<li id="menu_products"><a href="../products.php"></a></li>
					<li id="menu_store"><a href="store.php"></a></li>
					<li id="menu_contact"><a href="../contact.php"></a></li>
				</ul>
			</div>
		</div>
	</div>
<input type=hidden name='cardbg' value=
 
<input type="hidden" id="cardbg" name="cardbg" value=''></input>
 
<style> 
* {
padding : 0px;
margin : 0px;
}
 
.box {
        position: absolute;
        height: 98px;
        width: 98px;
        background: #CCF;
        border: 1px solid #AAD;
        text-align: center;
        font-size: 10px;
        }
 
.handle {
        cursor: move;
        }
 
html, body {
font-family : verdana;
}
 
#container2 {
border : 1 px solid blue;
width : 500px;
margin : 0px auto;
}
 
#canvas {
border : 1px solid black;
height : 300px;
width : 500px;
}
 
#toolbar {
border : 1px solid black;
border-bottom : 0px;
height : 150px;
width : 100%;
background : lightgray;
}
 
.object {
display : table;
clear : both;
	border : 1px dashed transparent;
}
 
.selected {
	border : 1px dashed black;
}
 
ul#icons {margin: 0; padding: 0; position : relative; top : -37px; float : right;}
ul#icons li {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left;  list-style: none;}
ul#icons span.ui-icon {float: left; margin: 0 4px;}
 
 
#tb_fontcolor {
	position: relative;
	width: 36px;
	height: 36px;
	background: url(images/select.png);
}
#tb_fontcolor div {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 30px;
	height: 30px;
	background: url(images/select.png) center;
}
 
.progressBox {
  width: 10em;
        height: 1em;
        position: relative;
        float: right;
        background: #cccccc;
 
.progressBar {
  width: 0;
  height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        background: #00df00;
}
 
.fileToUpload {
  float: right;
  margin-right: .5em;
}
 
/* Style for IFRAME */
.loader {
  border: 0;
  height: 0;
  width: 0;
  padding: 0;
  position: absolute;
  visibility: hidden;
}
 
</style>
 
<link rel="stylesheet" href="jquery-ui-1.7.1.custom.css" type="text/css"></link>
<link rel="stylesheet" href="css/colorpicker.css" type="text/css" />
 
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.7.1.custom.min.js"></script>
<script type="text/javascript" src="js/jquery.selectboxes.min.js"></script>
<script type="text/javascript" src="js/jquery.checkboxes.min.js"></script>
<script type="text/javascript" src="js/colorpicker.js"></script>
<script type="text/javascript" src="js/eye.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/layout.js?ver=1.0.2"></script>
 
<script type="text/javascript"> 
<!--
	var card_id = gup('card_id');
	var card_img = './'+card_id+'.png';
	var card_xml = 'cards/'+card_id+'.xml';
	document.write (card_xml);
	//var card_xml = "cards/0000001.xml";
	var canvas_width = 500;
	var canvas_height = 300;
 
	var timeout = undefined;
 
	function gup( name ) {
		name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
		var regexS = "[\\?&]"+name+"=([^&#]*)";
		var regex = new RegExp( regexS );
		var results = regex.exec( window.location.href );
		if( results == null )
			return "";
		else
			return results[1];
	}
 
 
		var cbloadcard = function() {
		$.ajax({
			type: "GET",
			url: card_xml,
			dataType: "xml",
			success: function(xml) {
 
				var $bg = $(xml).find('card').attr('background');
				$("#canvas").css("background-image", "url(\'cardbg/" + $bg + "\')");
 
				$(xml).find('object[type=text]').each(function(i){
					var content = $(this).find('content').text();
					var color = $(this).find('color').text();
					var size = $(this).find('size').text();
					var font = $(this).find('font').text();
					var bold = $(this).find('font').attr('bold');
					var italic = $(this).find('font').attr('italic');
 
					var top = $(this).find('top').text() / 100 * 300;
					var left = $(this).find('left').text() / 100 * 500;
					var image = $(xml).find('image').text();
					documentWrite(image);
 
					$('<span id="obj_'+i+'" class="object"></span>')
						.attr("cb_content",content)
						.attr("cb_color",color)
						.attr("cb_size",size)
						.attr("cb_font",font)
						.attr("cb_bold",bold)
						.attr("cb_italic",italic)
						.attr("cb_type","text")
						.attr("image","image")
						.css({'position' : 'relative', 'top' : top, 'left' : left})
						.appendTo('#canvas');
 
					imageFromObject($('#obj_'+i));
 
				});
				cbinit();
			}
		});
}
 
 
	var cbinit = function() {
 
		$(".object").draggable({ containment: '#canvas', scroll: false, cursor: 'crosshair', grid: [5, 5], opacity: 0.35 });
 
	    // trigger a select on click
		$(".object").click(function () {
			$("#tb_object").selectOptions($(this).attr("id"));
			$(".object").removeClass("selected");
			$(this).addClass("selected");
 
			$('#tb_fontcolor div').css('backgroundColor', '#' + $(this).attr("cb_color"));
			$('#tb_fontcolor').ColorPickerSetColor($(this).attr("cb_color"));
			$("#tb_size").selectOptions($(this).attr("cb_size"));
			$("#tb_font").selectOptions($(this).attr("cb_font"));
 
			$("#tb_bold, #tb_italic").attr('checked', false);
 
			if ($(this).attr("cb_bold") == 'true') $("#tb_bold").attr('checked', true);
			if ($(this).attr("cb_italic") == 'true') $("#tb_italic").attr('checked', true);
 
			$("#tb_content").val($(this).attr("cb_content"));
 
		});
 
		// trigger click on drag
		$('.object').bind('dragstart', function(event, ui) {
			$(this).click();
		});
 
		$('.object').bind('dragstop', function(event, ui) {
			xmlOut();
		});
 
		// load objects in select box
		populateObjectSelector();
		// click first object
		$("#canvas").children().eq("0").click();
 
		/*
		CHANGE TRIGGERS
		*/
 
		$("#tb_object").change(function () { $("#tb_object option:selected").each(function () { $("#"+$(this).val()).click(); }); });
		$("#tb_font").change(function () { imageFromObject($('.selected').attr('cb_font',$('#tb_font option:selected').val())); });
		$("#tb_bold").change(function () { if ($('#tb_bold').attr('checked')) { imageFromObject($('.selected').attr('cb_bold','true')); } else { imageFromObject($('.selected').attr('cb_bold','false')); } });
		$("#tb_italic").change(function () { if ($('#tb_italic').attr('checked')) { imageFromObject($('.selected').attr('cb_italic','true')); } else { imageFromObject($('.selected').attr('cb_italic','false')); } });
		$("#tb_size").change(function () { imageFromObject($('.selected').attr('cb_size',$('#tb_size option:selected').val())); });
		$("#tb_content").bind('keyup', function() { clearTimeout(timeout); timeout = setTimeout(function() { imageFromObject($('.selected').attr('cb_content',$('#tb_content').val())); }, 500); });
 
		/*
		INITIALIZE COLOR PICJER
		*/
 
		$('#tb_fontcolor').ColorPicker({
			onShow: function (colpkr) { $(colpkr).fadeIn(500); return false; },
			onHide: function (colpkr) { $(colpkr).fadeOut(500); return false; },
			onChange: function (hsb, hex, rgb) {
				$('#tb_fontcolor div').css('backgroundColor', '#' + hex);
				clearTimeout(timeout);
				timeout = setTimeout(function() { imageFromObject($('.selected').attr('cb_color',hex)); }, 1000);
			}
		});
	};
 
	var imageFromObject = function(obj) {
		var font = $(obj).attr('cb_font');
		if ($(obj).attr('cb_bold') == 'true') font = font + '_Bold';
		if ($(obj).attr('cb_italic') == 'true') font = font + '_Italic';
		var imgurl = 'generator/file.drawtext2.php?'
					+"text='"+$(obj).attr('cb_content')
					+"'&amp;"
					+"font='"+'fonts/'+font+'.ttf'
					+"'&amp;"
					+"color=0x"+$(obj).attr('cb_color')
					+"&amp;"
					+"size="+$(obj).attr('cb_size')
					+"&amp;"
					+"type=png"
					+"&amp;"
					+"palette=256"
					+"&amp;"
					+"antialias=1"
					;
		$(obj).html('<img src="'+imgurl+'" />');
		xmlOut();
	}
 
	var px2pct = function(px,total) {
		px = px.substr(0,px.length-2);
		return Math.round(px / total * 100);
	}
 
	var xmlOut = function() {
		$("#xml_out").val('');
		var xml = '';
		xml = xml+'<card>'+"\n\t"+'<objects>'+"\n";
		$("#canvas").children().each(function (i) {
			xml = xml+'		<object type="'+$(this).attr("cb_type")+'">'+"\n";
			xml = xml+'			<content>'+$(this).attr("cb_content")+'</content>'+"\n";
			xml = xml+'			<size>'+$(this).attr("cb_size")+'</size>'+"\n";
			xml = xml+'			<color>'+$(this).attr("cb_color")+'</color>'+"\n";
			xml = xml+'			<font bold="'+$(this).attr("cb_bold")+'" italic="'+$(this).attr("cb_italic")+'">'+$(this).attr("cb_font")+'</font>'+"\n";
			xml = xml+'			<top>'+px2pct($(this).css("top"),canvas_height)+'</top>'+"\n";
			xml = xml+'			<left>'+px2pct($(this).css("left"),canvas_width)+'</left>'+"\n";
			xml = xml+'		</object>'+"\n";
		});
		xml = xml+"\t"+'</objects>'+"\n"+'</card>'+"\n";
		$("#xml_out").val(xml);
	};
 
 
	var populateObjectSelector = function() {
		$("#tb_object").removeOption(/./);
		$("#canvas").children().each(function (i) {
			$("#tb_object").addOption($(this).attr("id"), $(this).attr("id"));
		});
	};
 
	$(document).ready(function () {
		cbloadcard();
	});
 
// -->
 
 
 
 
// Micox Upload Script 2
<!--
function micoxUpload2(form,timeout,loading,callback){
/**
* micoxUpload2 - Submete um form para um iframe oculto e pega o resultado. Consequentemente pode
*               ser usado pra fazer upload de arquivos de forma assíncrona.
* Versão: 2.0 - 02/01/2008
* Autor: Micox - www.elmicox.com - elmicox.blogspot.com
* Licença: Creative Commons - http://creativecommons.org/licenses/by/2.5/br/
* Some Rights Reserved - http://creativecommons.org/licenses/by/2.5/
**/
 
        var $gE, addEvent, removeEvent, periodic, loadAnim, loaded, abortFrame; //small functions
        var error_prog = []; //errors by programer
        var new_form, loading_msg, loadpos=0; //the new form that will replace old form AND loading msg
        var z, old_action, concat, timeload, timecounter=0, iframe, name;
        var loads = ['&nbsp;&nbsp;&nbsp;','.&nbsp;&nbsp;','..&nbsp;','...']; //loading animation
 
        /*** small functions */
        $gE = function(quem){ return document.getElementById(quem) }
        addEvent = function(obj, evType, fn){
                if (obj.addEventListener){ obj.addEventListener(evType, fn, true) ; }
                if (obj.attachEvent) { obj.attachEvent("on"+evType, fn);}
        }
        removeEvent = function( obj, type, fn ) {
                if ( obj.detachEvent ) { obj.detachEvent( 'on'+type, fn ); }
                if ( obj.removeEventListener ) { obj.removeEventListener( type, fn, false ); }
        }
        loadAnim = function(){ //get animation of array loads
                if(loading.indexOf('<img')<0){ // 3 dots just if no image
                        if(loadpos>loads.length - 1){ loadpos = 0; }
                        return loads[loadpos++] + ' ';
                }else{ return '';}
        }
        periodic = function(){
                timecounter++ ;
if(timecounter/2 > timeout && timeout > 0){ //timeout expired (timeout = 0 is infinite)
                        clearInterval(timeload); //fim do contador
                        abortFrame(name);
                        loaded('timeout');
                }
                loading_msg.innerHTML = loading + ' ' + loadAnim();
        }
        abortFrame = function(o_frame){ //stop iframe
                var o_frame = typeof(o_frame)=="string" ? $gE(o_frame):o_frame;
                if(!o_frame){ return false; }
                try{ o_frame.contentWindow.stop(); //FF e OP
                }catch(e){
                        try{ o_frame.contentWindow.document.execCommand('stop');//IE
                        } catch(e){     o_frame.src = ''; /* tenta parar mermo */ }
                }
        }
        cloneEvents = function(source2,target,recursive){
                for(var p in source2){ //all params
                        try{if(source2[p].constructor==Function){
                                        target[p] = source2[p]
                        }}catch(e){}
                }
                if(recursive){
                        for(var el=0; el<source2.childNodes.length; el++){
                                var elem = source2.childNodes[el]
                                var elem_target = target.childNodes[el]
                                if(elem.nodeType==1){
                                        cloneEvents(elem,elem_target);
                                }
                        }
                }
        }
 
 
        //testing callback
if(typeof(callback)!='function'){ error_prog.push("The 'callback' parameter must be a function") }
 
        //testing if 'form' is a html object or a id string
        form = typeof(form)=="string" ? $gE(form):form;
        if(form.nodeName.toUpperCase()!='FORM'){
                error_prog.push("The first parameter must be a form element ID or a form element reference") }
 
        //testing if form have some input file
        var input_file = false;
        var infile = form.getElementsByTagName('input')
        for(z in infile){
                if(infile[z].type=='file'){
                        if(infile[z].value==''){
                                alert("The input is empty. I cant upload this.")
                                return true;
                        }else{
                                input_file = infile[z];
                        }
                }
        }
        if(input_file==false){ error_prog.push("The form must be a input type file") }
 
        //exit if programmer errors
        if(error_prog.length>0) {
                alert("Error in parameters of micoxUpload:\n\n" + error_prog.join('\n'));
                /* uncoment this if you want use try-catch-throw
                throw(error_prog.join('\n'))
                return true;    */
        }
 
        //random id for multiple calls
        rand = (m=Math).round( 20 * m.random() );
 
 //adding callback function to global scope
        //window['micoxCallbackTemp' + rand] = callback
 
        //creating the iframe
        name = "micox-temp" + rand;
        iframe = document.createElement("iframe");
        iframe.setAttribute("id",name);
        iframe.setAttribute("name",name);
        iframe.setAttribute("width","0");
        iframe.setAttribute("height","0");
        iframe.setAttribute("border","0");
        iframe.setAttribute("style","width: 0; height: 0; border: none;");
        //add to document
        form.parentNode.appendChild(iframe);
        window.frames[name].name = name; //ie sucks
 
        //event after load
        loaded = function(){
                //var iframe2 = $gE(name);
                clearInterval(timeload); //fim do contador
                //first, removing the event of iframe
                removeEvent(iframe,'load',loaded)
                //removind loading msg
                loading_msg.parentNode.removeChild(loading_msg);
                //removing old form
                //form.parentNode.removeChild(form);
 
                //calling callback with the return
                if(arguments[0]!='timeout'){
                        callback(iframe.contentWindow.document.body.innerHTML);
                }else{
                        callback('Timeout expired. ' + timeout + ' secs.');
                }
 
                //removing old iframe
                abortFrame(iframe);
                iframe.src=''; //to stop 'loadind' in FF. bug.
 
	iframe.parentNode.removeChild(iframe);
                delete iframe;
        }
        //adding the event
        addEvent(iframe,'load',loaded)
 
        //properties of form to a normal upload
        form.setAttribute("target",name);
        form.setAttribute("method","post");
        form.setAttribute("enctype","multipart/form-data");
        form.setAttribute("encoding","multipart/form-data");
        //aditional information if micoxUpload
        old_action = form.action;
        if(form.action.indexOf('?')>1){ concat = '' } else { concat = '?' }
        //form.setAttribute("action",form.action + concat + 'micoxUpload=1');
	form.setAttribute("action",form.action + concat + '');
 
        //submit
        form.submit();
 
        //make loading
	loading_msg = document.createElement('div');
        loading_msg.innerHTML = loading;
        form.parentNode.insertBefore(loading_msg,form);
        //making new form and hidden old form
        input_file.value='';
        form.reset();
        new_form = form.cloneNode(true);
        cloneEvents(form,new_form,true);
        new_form.reset();
        new_form.action = old_action;
        form.style.display = 'none';
        form.parentNode.insertBefore(new_form,form);
        //if you want new input file before the 'loading div', use this above (invert the comment)
        //form.parentNode.insertBefore(new_form,loading_msg);
 
        timeload = setInterval(periodic,500);
 
        //no submit default
        return false;
}
 
//-->
 
</script>
 
<form action="/dvrg04222009/store/?card_id=0000004/bizcard3.php" id='form_up3' method=post>
 
 
<div id="body">
	<div id="body_container">
		<div id="container2">
			<!--<h1>--><font size=3><b>Card Builder</b></font><!--</h1>-->
			<div id="toolbar">
				Object : <select id="tb_object"></select><br />
 
				Font : <select id="tb_font"><option value='Andale_Mono'>Andale_Mono</option><option value='Arial'>Arial</option><option value='Comic_Sans_MS'>Comic_Sans_MS</option><option value='Courier_New'>Courier_New</option><option value='Georgia'>Georgia</option><option value='Impact'>Impact</option><option value='Times_New_Roman'>Times_New_Roman</option><option value='Trebuchet_MS'>Trebuchet_MS</option><option value='Verdana'>Verdana</option></select>
<!--Verdana-->
				Size : <select id="tb_size"><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='11'>11</option><option value='12'>12</option><option value='13'>13</option><option value='14'>14</option><option value='15'>15</option><option value='16'>16</option><option value='17'>17</option><option value='18'>18</option><option value='19'>19</option><option value='20'>20</option><option value='21'>21</option><option value='22'>22</option><option value='23'>23</option><option value='24'>24</option><option value='25'>25</option><option value='26'>26</option><option value='27'>27</option><option value='28'>28</option><option value='29'>29</option><option value='30'>30</option><option value='31'>31</option><option value='32'>32</option><option value='33'>33</option><option value='34'>34</option><option value='35'>35</option><option value='36'>36</option><option value='37'>37</option><option value='38'>38</option><option value='39'>39</option><option value='40'>40</option><option value='41'>41</option><option value='42'>42</option></select>
				Bold : <input id="tb_bold" type="checkbox">
				Italic : <input id="tb_italic" type="checkbox"><br />
 
				Color : <div id="tb_fontcolor"><div style="background-color: #000000"></div></div>
					     <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
										          
		  
<script type="text/javascript">
       		//function end_upload3(data){
			//ge = document.getElementById('returnUp');
			//ge.style.display = "block";
			//ge.innerHTML = returnUp;
	//document.getElementById('returnUp').innerHTML += returnUp + data;
			//alert(data);
		//}
		function end_upload3(data){
  		var ge = document.getElementById('returnUp');
		  if (ge) {
		    ge.style.display = "block";
		    ge.innerHTML = data;
		  }
		}  
	</script>
Logo:&nbsp;&nbsp;  
<input type='file' name='name_1' onchange="micoxUpload2(this.form,0,'<img src=\'load.gif\' /> Loading...',end_upload3)" />
 
<div id='returnUp' name='returnUp'><br />
</div>
 
 
 
<div style="position:absolute; top: 279px; left: 580px;">
<br><br>Text :&nbsp;&nbsp; <input id="tb_content" />
</div>
	<ul id="icons" class="ui-widget ui-helper-clearfix">
	<li class="ui-state-default ui-corner-all" title=".ui-icon-circle-plus"><span id="tb_addtext" class="ui-icon ui-icon-circle-plus">Add New</span></li>
				</ul>
			</div>
 
			<div id="canvas"></div>
			
<!--<script type="text/javascript">-->
	
<div class="drag"><img class="drag" src="upload/"></div>
 
             <pre id="debug"></pre>
             <script language="JavaScript" type="text/javascript">
             <!--
 
             // this is simply a shortcut for the eyes and fingers
                function $(id)
                {
                        return document.getElementById(id);
                }
 
                var _startX = 0;                        // mouse starting positions
                var _startY = 0;
                var _offsetX = 0;                       // current element offset
                var _offsetY = 0;
                var _dragElement; // needs to be passed from OnMouseDown to OnMouseMove
                var _oldZIndex = 0;  // we temporarily increase the z-index during drag
                var _debug = $('debug');        // makes life easier
 
 InitDragDrop();
 
                function InitDragDrop()
                {
                        document.onmousedown = OnMouseDown;
                        document.onmouseup = OnMouseUp;
                }
 
                function OnMouseDown(e)
                {
                        // IE is retarded and doesn't pass the event object
                        if (e == null)
                                e = window.event;
                // IE uses srcElement, others use target
                        var target = e.target != null ? e.target : e.srcElement;
 
                        _debug.innerHTML = target.className == 'drag'
                                ? 'draggable element clicked'
                                : 'NON-draggable element clicked';
 
                        // for IE, left click == 1
                        // for Firefox, left click == 0
                        if ((e.button == 1 && window.event != null ||
                                e.button == 0) &&
                                target.className == 'drag')
                        {
                                // grab the mouse position
                                _startX = e.clientX;
                                _startY = e.clientY;
 
                                // grab the clicked element's position
                                _offsetX = ExtractNumber(target.style.left);
                                _offsetY = ExtractNumber(target.style.top);
 
                  // bring the clicked element to the front while it is being dragged
                                _oldZIndex = target.style.zIndex;
                                target.style.zIndex = 10000;
 
                                // we need to access the element in OnMouseMove
                                _dragElement = target;
 
                          // tell our code to start moving the element with the mouse
                                document.onmousemove = OnMouseMove;
 
                                // cancel out any text selections
                                document.body.focus();
				// prevent text selection in IE
                                document.onselectstart = function () { return false; };
                                // prevent IE from trying to drag an image
                                target.ondragstart = function() { return false; };
 
                                // prevent text selection (except IE)
                                return false;
                        }
                }
 
                function ExtractNumber(value)
                {
                        var n = parseInt(value);
 
                        return n == null || isNaN(n) ? 0 : n;
                }
 
                function OnMouseMove(e)
                {
                        if (e == null)
                                var e = window.event;
 
                        // this is the actual \"drag code\"
                        _dragElement.style.left = (_offsetX + e.clientX - _startX) + 'px';
                        _dragElement.style.top = (_offsetY + e.clientY - _startY) + 'px';
 
                        _debug.innerHTML = '(' + _dragElement.style.left + ', ' + _dragElement.style.top + ')';
                }
 
                function OnMouseUp(e)
                {
                        if (_dragElement != null)
                        {
                                _dragElement.style.zIndex = _oldZIndex;
 
                             // we're done with these events until the next OnMouseDown
                                document.onmousemove = null;
                                document.onselectstart = null;
                                _dragElement.ondragstart = null;
 
                                // this is how we know we're not dragging
                                _dragElement = null;
 
                               //_debug.innerHTML = 'mouse up';
 }
                }
                        </script>
 
 
			<textarea id="xml_out" cols="60" rows="15" style="display : none;"></textarea>
</div>
 
</div>
 
</div>
 
<div style="position: absolute; left: 800px; top: 635px;"><input type="image" src="../edstore/images/next.png" width="50"></div>
 
</form>
 
 
 
 
	<div id="footer">
		<div id="footer2">
			<img class="footerimg" src="../images/footers/footer-either-way.png" width="800" height="60" alt="footer image" />			<div>
				<span class="right">
<img src="../images/footer_logo_kcdma.png" width="60" height="50" border="0" alt="KCDMA logo" />
<img src="../images/footer_logo_icma.png" width="60" height="50" border="0" alt="ICMA logo" />
<img src="../images/footer_logo_dma.png" width="68" height="50" border="0" alt="DMA logo" />
<img src="../images/footer_logo_pci.png" width="57" height="50" border="0" alt="PCI logo" />
<img src="../images/footer_logo_security.png" width="79" height="50" border="0" alt="Secure Credit Card logo" /></span>
				<span class="left" style="text-align : left;">Copyright &copy; 2009 <strong>Digital Vision Resources Group</strong>, all rights reserved<br />PH: <strong>913-402-5900</strong> Toll-Free: <strong>877-402-5930</strong><br />
				<a href="sitemap.php">Sitemap</a> | Valid <a href="http://jigsaw.w3.org/css-validator/validator?uri=192.168.221.128/dvrg04222009/store/index.php&amp;profile=css3&amp;usermedium=all&amp;warning=no&amp;lang=en">CSS</a> &amp; <a href="http://validator.w3.org/check?uri=referer">XHTML</a> </span>
			</div>
		</div>
	</div>
</div>
 
</body>
</html>

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361:
362:
363:
364:
365:
366:
367:
368:
369:
370:
371:
372:
373:
374:
375:
376:
377:
378:
379:
380:
381:
382:
383:
384:
385:
386:
387:
388:
389:
390:
391:
392:
393:
394:
395:
396:
397:
398:
399:
400:
401:
402:
403:
404:
405:
406:
407:
408:
409:
410:
411:
412:
413:
414:
415:
416:
417:
418:
419:
420:
421:
422:
423:
424:
425:
426:
427:
428:
429:
430:
431:
432:
433:
434:
435:
436:
437:
438:
439:
440:
441:
442:
443:
444:
445:
446:
447:
448:
449:
450:
451:
452:
453:
454:
455:
456:
457:
458:
459:
460:
461:
462:
463:
464:
465:
466:
467:
468:
469:
470:
471:
472:
473:
474:
475:
476:
477:
478:
479:
480:
481:
482:
483:
484:
485:
486:
487:
488:
489:
490:
491:
492:
493:
494:
495:
496:
497:
498:
499:
500:
501:
502:
503:
504:
505:
506:
507:
508:
509:
510:
511:
512:
513:
514:
515:
516:
517:
518:
519:
520:
521:
522:
523:
524:
525:
526:
527:
528:
529:
530:
531:
532:
533:
534:
535:
536:
537:
538:
539:
540:
541:
542:
543:
544:
545:
546:
547:
548:
549:
550:
551:
552:
553:
554:
555:
556:
557:
558:
559:
560:
561:
562:
563:
564:
565:
566:
567:
568:
569:
570:
571:
572:
573:
574:
575:
576:
577:
578:
579:
580:
581:
582:
583:
584:
585:
586:
587:
588:
589:
590:
591:
592:
593:
594:
595:
596:
597:
598:
599:
600:
601:
602:
603:
604:
605:
606:
607:
608:
609:
610:
611:
612:
613:
614:
615:
616:
617:
618:
619:
620:
621:
622:
623:
624:
625:
626:
627:
628:
629:
630:
631:
632:
633:
634:
635:
636:
637:
638:
639:
640:
641:
642:
643:
644:
645:
646:
647:
648:
649:
650:
651:
652:
653:
654:
655:
656:
657:
658:
659:
660:
661:
662:
663:
664:
665:
666:
667:
668:
669:
670:
671:
672:
673:
674:
675:
676:
677:
678:
679:
680:
681:
682:
683:
684:
685:
686:
687:
688:
689:
690:
691:
692:
693:
694:
695:
696:
697:
698:
699:
700:
701:
702:
703:
704:
705:
706:
707:
708:
709:
710:
711:
712:
713:
714:
715:
716:
717:
718:
719:
720:
721:
722:
723:
724:
725:
726:
727:
728:
729:
730:
731:
732:
733:
734:
735:
736:
737:
738:
739:
740:
741:
742:
743:
744:
745:
746:
747:
748:
749:
750:
751:
752:
753:
754:
755:
756:
757:
758:
759:
760:
761:
762:
763:
764:
765:
766:
767:
768:
769:
770:
771:

Select allOpen in new window

 

by: mplungjanPosted on 2009-06-16 at 01:56:27ID: 24636060

so there is something in the XML that the script cannot find

Fir see if the actual XML is available
so load
http://www.yourserver.com/cards/whateverTheCardIdIs.xml


You could try firefox and the javascript console to pinpoint what statement that fails, obviously IE does nto know what line it the correct one

Then you can add an alert in front of each find (or move one alert)

alert($(this).find('content').text()); // if you fail here then you need to look if the xml is actually loaded
var content = $(this).find('content').text();



 

by: ecross102301Posted on 2009-06-16 at 08:18:29ID: 24638876

This is what is in the xml file:

  <?xml version="1.0" encoding="iso-8859-1" ?>
- <card background="../cardbg/cardbg_0004.png">
- <objects>
- <object type="text">
  <content>Customer Name</content>
  <size>32</size>
  <color>1ed65f</color>
  <font bold="true" italic="false">Georgia</font>
  <top>35</top>
  <left>15</left>
  </object>
- <object type="text">
  <content>Job Title</content>
  <size>20</size>
  <color>1ed65f</color>
  <font bold="false" italic="false">Arial</font>
  <top>45</top>
  <left>-30</left>
  </object>
- <object type="text">
  <content>cname@website.com</content>
  <size>16</size>
  <color>000000</color>
  <font bold="false" italic="true">Arial</font>
  <top>65</top>
  <left>1</left>
  </object>
- <object type="text">
  <content>(413) 555-5555</content>
  <size>16</size>
  <color>000000</color>
  <font bold="false" italic="true">Arial</font>
  <top>75</top>
  <left>-40</left>
  </object>
- <object type="image">
- <content>
  <?php echo $_FILES["name_1"]["name"];?>
  </content>
  </object>
  </objects>
  </card>

 

by: ecross102301Posted on 2009-06-16 at 09:15:16ID: 24639505

no alerts appear when I add them to the code.

 

by: mplungjanPosted on 2009-06-16 at 23:51:39ID: 24645487

Obviously this is not valid xml:

<content>
 <?php echo $_FILES["name_1"]["name"];?>
  </content>

 

by: ecross102301Posted on 2009-06-17 at 08:28:44ID: 24649348

then how do I get the value from a php variable into the xml file?

 

by: mplungjanPosted on 2009-06-17 at 10:25:56ID: 24650528

By making the xml ALSO php

<?php
header('Content-type: text/xml'); // or application/xml
echo $static_xml_start;
echo $_FILES["name_1"]["name"];
echo $static_xml_end;
?>

 

by: ecross102301Posted on 2009-06-18 at 12:45:21ID: 24661098

this did not work. I get errors static_xml_start is undefined and static_xml_end is undefined.

I need to be able to automatically change that value in the xml file when the file is uploaded.

 

by: mplungjanPosted on 2009-06-18 at 12:55:33ID: 24661184

The static_xml_start is of course the xml you had beginning with

<?xml version="1.0" encoding="iso-8859-1" ?>
- <card background="../cardbg/cardbg_0004.png">
.
.
- <object type="image">
- <content>


and the end is

</content>
 </object>
 </objects>
 </card>



 

by: ecross102301Posted on 2009-06-18 at 16:20:14ID: 24662678

I am not following what you are saying then, those are two disparately different possible attempts to try,  Please be more specific in what you are saying...

 

by: mplungjanPosted on 2009-06-18 at 23:56:28ID: 24664282

You showed me what I believe is a static xml file with dynamic php include near the end.
If you load such an xml file from a folder on a web server, you will get the TEXT
 <?php echo $_FILES["name_1"]["name"];?>
inside the xml when it hits the browser.
So for this to work, you will need to EITHER change

 <?php echo $_FILES["name_1"]["name"];?>

to the actual name of the file OR as I suggested, change

var card_xml = 'cards/'+card_id+'.xml';


to something like

var card_xml = 'cards.php?id='+card_id

and have the php generate the xml like I suggested.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...