Jump to content
Old threads will finally start getting archived ×

Search the Community

Showing results for tags 'javascript'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. Can anyone give me an idea on how I will count the table column and table row and get the id, attribute and the content of a each cell (the cell is contenteditable). What tools i have to use. e.g. <table id='sheet'> <tbody> <tr> <td id='1A' rowspan=2>Rowspan 2</td> <td id='1B'>22222</td> <td id='1C'>33333</td> </tr> <tr> <td id='2B' colspan='2'> Colspan2</td> </tr> <tr> <td id='3A' style='color:red'>Whaterver</td> <td id='3B' style='font-weight:bold'>Askyourmother</td> <td id='3C'>sigh</td> </tr> </tbody> </table> I'm using PHP and Jquery(Javascript). Thanks. .
  2. i want to manipulate a joomla component for my site. component has no ability to do what i want. i create a db row for component, for every new users. but i coudn't resolve parent id column to insert the correct value. i have to login to panel and open that category id, and just click "save and close" button for every new users. it is a manuel solution. but can i do it by running "file_get_contents". like this: $url = "/index.php?option=com_joomgallery&controller=categories&task=edit&cid=59"; $postdata=http_build_query(array("usr" => "xxxx", "pass" => "xxx", "cid" => "59", "javascript" => ""Joomla.submitbutton('save')"")); $opts = array('http' => array('method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata)); $context = stream_context_create($opts); $result = file_get_contents($url, false, $context); source code part: <li class="button" id="toolbar-save"> <a href="#" onclick="Joomla.submitbutton('save')" class="toolbar"> <span class="icon-32-save"> </span> Save & Close </a> </li> could i explain the problem clearly??? categories.php
  3. mainpage.php, loginModal.php, signInvalidate.php I have a page has a button that when click a modal dialog box pop up, the content of the modal is from other page(loginModal.php) using jquery .load, so the content now of the modal is a login form which validates using jquery ajax that send information to signInvalidate.php. I have no problem on validation it still return error if it is error, but if it is correct information I want to reload the main page. How will I do that? or does Jquery .load accepting return TRUE value. e.g. signInvalidate.php $result = $userFunction->checkLogin($useremail, @$password, @$remember, $gotUrl); if($result == TRUE){ return TRUE; } loginModal.php success: function(msg){ if(msg == TRUE){ return true; }else{ $("#signInOutput").html(msg); } } mainpage.php $('#previewOutput').load('modalLogin.php', function(){ });
  4. im designing a online coupon site,,, there are several products displaying in my home page, when you click on each product, there is a coupon image displaying, but All that i want is, i want the users select the products they like. and there is a seperate print button. so i wanted the users to print the coupon of multiple selected products at once when click on the print button... for exaample, simillar as this website: visit http://www.coupons.com/
  5. HI , I am begineer in the field of webdesigning. I am facing problem with a java script which is working at one places but doesnot at another. Test.php -- working fine <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <script type="text/javascript"> var clone; function cloneRow(){ var rows=document.getElementById('mytab').getElementsByTagName('tr'); var index=rows.length; clone=rows[index-1].cloneNode(true); var inputs=clone.getElementsByTagName('input'), inp, i=0,n ; while(inp=inputs[i++]){ inp.name=inp.name.replace(/\d/g,'')+(index+1); } } function addRow(){ var tbo=document.getElementById('mytab').getElementsByTagName('tbody')[0]; tbo.appendChild(clone); cloneRow(); } function addValue(obj){ obj.value=obj.value.replace(/[^\d]/,''); var fields=document.getElementsByTagName('input'), i=0, tot=0, f; while(f=fields[i++]){ f.name&&f.name.match(/cost/)?tot+=Number(f.value):null; } document.getElementsByName('sum')[0].value=tot; } onload=cloneRow; </script> </head> <body> <?php $host="localhost"; // Host name $username="root"; // Mysql username $password="root"; // Mysql password $db_name="teanest"; // Database name // Connect to server and select databse. $con=mysql_connect("$host", "$username", "$password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("$db_name")or die("cannot select DB"); $sql="select id,name from items order by name"; $result = mysql_query ($sql); $sql1="select id,name from suppliers order by name"; $result1=mysql_query($sql1); ?> <form action=""> <table> <tr> <td align="right">Item Name:</td> <td align="left"> </td> </tr> <tr> <td align="right">Supplier:</td> <td align="left"> <?php echo "<select name=\"suppliers\" value=''>Supplier</option>"; // printing the list box select command while($nt=mysql_fetch_array($result1)){//Array or records stored in $nt echo "<option value=$nt[id]>$nt[name]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </td> <tr> <td align="right">Date:</td> <td align="left"><input id='start_dt' class='datepicker' name="date"/></td> </tr> <tr> <td align="right">Bill No:</td> <td align="left"><input type="text" size="10" name="billNo" /></td> </tr> </table> <table id="mytab" border="1"> <tr> <th>Sl No.</th> <th>Item Name</th> <th>Quantity</th> <th>Unit</th> <th>Cost Price</th> </tr> <tr> <td><input type="text" size="3" name="slno"></td> <td> <?php echo "<select name=\"items\" value=''>Item</option>"; // printing the list box select command while($nt=mysql_fetch_array($result)){//Array or records stored in $nt echo "<option value=$nt[id]>$nt[name]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </td> <td><input type="text" size="4" name="quantity"></td> <td><input type="text" size="4" name="unit"></td> <td><input type="text" size="4" name="costprice" onkeyup="addValue(this)"></td> </tr> </table> <br> <input type="button" value="Add a new row" onclick="addRow()"> <p> Total: <input type="text" name="sum" readonly="readonly" value="Sum of Cost Price inputs"> </form> </body> </html> receivings.php-- doesnot work ... same javascript included in header part <?php include 'includes/header.inc.php'; ?> <div class="sidebar1"> <br><br> <ul class="nav"> <li><a href="#receive">Receive</a></li> <li><a href="#">Link two</a></li> <li><a href="#">Link three</a></li> <li><a href="#">Link four</a></li> </ul> <!-- end .sidebar1 --></div> <?php $host="localhost"; // Host name $username="root"; // Mysql username $password="root"; // Mysql password $db_name="teanest"; // Database name // Connect to server and select databse. $con=mysql_connect("$host", "$username", "$password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("$db_name")or die("cannot select DB"); $sql="select id,name from items order by name"; $result = mysql_query ($sql); $sql1="select id,name from suppliers order by name"; $result1=mysql_query($sql1); ?> <div id="receive" class="modalDialog"> <div> <a href="#close" title="Close" class="close">X</a> <form name="receive" method="post" action="receive.php"> <fieldset> <legend>Receive:</legend> <table> <tr> <td align="right">Supplier:</td> <td align="left"> <?php echo "<select name=\"suppliers\" value=''>Supplier</option>"; // printing the list box select command while($nt=mysql_fetch_array($result1)){//Array or records stored in $nt echo "<option value=$nt[id]>$nt[name]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </td> <tr> <td align="right">Date:</td> <td align="left"><input id='start_dt' class='datepicker' name="date"/></td> </tr> <tr> <td align="right">Bill No:</td> <td align="left"><input type="text" size="10" name="billNo" /></td> </tr> </table> <br><br> <!--// receivings transaction table --> <table id="mytab" border="1"> <tr> <th>Sl No.</th> <th>Item Name</th> <th>Quantity</th> <th>Unit</th> <th>Cost Price</th> </tr> <tr> <td><input type="text" size="3" name="slno"></td> <td> <?php echo "<select name=\"items\" value=''>Item</option>"; // printing the list box select command while($nt=mysql_fetch_array($result)){//Array or records stored in $nt echo "<option value=$nt[id]>$nt[name]</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> </td> <td><input type="text" size="4" name="quantity"></td> <td><input type="text" size="4" name="unit"></td> <td><input type="text" size="4" name="costprice" onkeyup="addValue(this)"></td> </tr> </table> <br> <input type="button" value="Add a new row" onclick="addRow()"> <p> Total: <input type="text" name="sum" readonly="readonly" value="Sum of Cost Price inputs"> </fieldset> <input type="submit" value="Receive"> </form> </div> </div> <div class="content"> <h1>List Of Receivings:</h1> </div> <!-- end .content --></div> <?php include 'includes/footer.inc.php'; ?> Please help !!!
  6. I am trying to do a mouseover/mouseout on an image in a table. Right now I have it working with Javascript. You click on the camera and the image comes up in a new window. However; I want to do it with a mouseover like this. http://www.menuhead.net/PopUP/mouseover-popup/over.php I know mouseover is client side so how would I do this with php. function newPopup(url) { popupWindow = window.open( url,'popUpWindow','height=300,width=300,left=10,top=10,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=no' ) } <td><a href=Javascript:newPopup('$row[LocationPix]');><img src='http://www.menuhead.net/Images/Buttons/PShotClear.png'</td> Thank you.
  7. I'm new here and looking for help with a problem (already tried googling it, though I'm not sure I'm even explaining it correctly). The only file visible to the user is this <?php include "../../the-actual-site/index.php"; ?> The rest of the site is behind the "www" folder, and uses includes, get, and session, variables to navigate the pages. Now I want to add some javascript to the display pages, but some nasty things are happening when i do, i trimmed everything down to a bare example (just to make sure something else was not interfering), but these problems still persist. So for the example page I have setup the index.php in the www folder the same way, and used the page from this tutorial as a working example. The tutorial pages work fine if laid out as instructed, or renamed/moved around (but not included). So the first problem is that that the javascript requires me to expose the "index.php" part of the url to send a get variable. (I trued outputting just the "?var=" part, and it did not work) The production site never exposes this, and while I don't believe it would cause an issue, I would rather keeps things "as-is" than having people freak out over it. The second issues is that the javascript is making the page display twice once it starts working. Another instance of the page is created below the first one (the second is non-functional). So first, how can I use js in an include without the page duplicating? And second how do I get javascript to output clean GET variables without showing the "index.php" part?
  8. Dear all, I have having a text area field which has a limit of 100 characters only. Now, i also want to validate it such that it should only contain letter's (alphabet A-Z .a-z). It should not contain any number or @ symbol. If such things entered it should throw me an error saying invalid arguments like that. I know it can be done with regular expressions. But i m not aware of how to do. Can some one help with that. Here is my script. <script language="javascript" type="text/javascript"> function limitText(limitField, limitCount, limitNum) { if (limitField.value.length > limitNum) { limitField.value = limitField.value.substring(0, limitNum); } else { limitCount.value = limitNum - limitField.value.length; } } </script> <tr> <td valign="top" align="left">Description</td> <td valign="top">:</td> <td align="left"><textarea name="limitedtextarea" onkeydown="limitText(this.form.limitedtextarea,this.form.countdown,100);" onkeyup="limitText(this.form.limitedtextarea,this.form.countdown,100);"> </textarea><br> <font size="1">(Maximum characters: 100)<br> You have <input readonly type="text" name="countdown" size="3" value="100"> characters left.</font></td> </tr>
  9. Hey guys why do i keep getting a problem with a redirect loop... i dont know why and i just get: http://www.powerwashers.co.uk/temp/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/index.php Its mainly when i click that google link although its just been happening on most things i do... also it doesnt display in firefox :/... Can anyone help me please?. http://www.powerwashers.co.uk/temp/main/expo.php <!DOCTYPE html> <head> <title>Brendon Powerwashers - News & Exhibitions</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta name="language" content="en"/> <meta name="robots" content="index, follow"/> <meta name="description" content=""/> <meta name="keywords" content=""/> <link rel="stylesheet" href="stylesheet/style1.css" type="text/css"/> <link rel="stylesheet" href="stylesheet/style6.css" type="text/css"/> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/navigation_hide_show.js"></script> <script type="text/javascript" src="js/hover_script.js"></script> <script type="text/javascript" src="js/fader.js"></script> <script type="text/javascript" src="js/bg_fade.js"></script> <script type="text/javascript" src="js/jquery_script01.js"></script> <script type="text/javascript" src="js/app_fader.js"></script> <script type="text/javascript" src="js/navigation_dropdown.js"></script> </head> <body style='display:none;' class='body'> <div id="header"> <?php include('content/navigation2.php'); ?> </div> <div id="page_wrapper"> <div id="page"> <?php include('content/acc_navigation.php'); ?> <div id="fp_top2" style='margin-bottom:-3px;'> <div id="fp_nav"> <ul> <a href="#" id="fade1_link"><li>Exhibitions</li></a> <a href="#" id="fade2_link"><li>Latest News</li></a> <a><li> </li></a><!--id="fade3_link"--> <a><li> </li></a><!--id="fade4_link"--> <a><li> </li></a><!--id="fade5_link"--> <a><li> </li></a><!--id="fade6_link"--> <a><li> </li></a><!--id="fade7_link"--> </ul> </div> <div id="fader_img2"> <img id='fade1' class="fader_images" src="images/exhibition_banner.jpg" alt="Fader"/> <img id='fade2' class="fader_images" src="images/about_fader.jpg" alt="Fader"/> <img id='fade3' class="fader_images" src="images/fader/1_3.jpg" alt="Fader"/> <img id='fade4' class="fader_images" src="images/fader/1_4.jpg" alt="Fader"/> <img id='fade5' class="fader_images" src="images/fader/1_5.jpg" alt="Fader"/> <img id='fade6' class="fader_images" src="images/fader/1_6.jpg" alt="Fader"/> <img id='fade7' class="fader_images" src="images/fader/1_7.jpg" alt="Fader"/> </div> </div> <div> <div id="sheet2_1" class="fader_sheets"> <div class="white_bg"> <h1 style=" text-align:center; font-size:26px">Exhibitions</h1><br/> <?php $expire = date('Ymd'); $select_query8 = mysql_query("SELECT * FROM expos ORDER BY expire"); while($select_query_row8 = mysql_fetch_array($select_query8)){ if($select_query_row8['expire'] > $expire) { echo ' <div style="width:200px; height:300px; border:1px solid #000; float:left; margin-top:10px; margin-left:5px; margin-right:5px; margin-bottom:10px; padding:5px;"> <div style="width:300px; margin:0px auto;"><img src="images/logos/'.$select_query_row8['image_url'].'" alt="Show Logo"/></div> <h1 style="text-align:center;">'.$select_query_row8['header'].'</h1><h1 style="text-align:center; font-size:14px; margin-top:4px">('.$select_query_row8['start_day'].'/'. $select_query_row8['start_month'].'/'.$select_query_row8['start_year']. ' - '.$select_query_row8['end_day'].'/'. $select_query_row8['end_month'].'/'.$select_query_row8['end_year'].')</h1><br/>'; echo '<p style="text-align:center">'.$select_query_row8['content'].'<br/><a href="www.google.com" class="expo1" >www.google.com</a></p> </div> '; } } ?> </div> </div> <div id="sheet2_2" class="fader_sheets"> <div class="white_bg"> <h1 style=" text-align:center; font-size:26px">Latest News</h1> <p>Coming Soon...</p> </div> </div> <div id="sheet2_3" class="fader_sheets"> <div class="white_bg"> </div> </div> <div id="sheet2_4" class="fader_sheets"> <div class="white_bg"> </div> </div> <div id="sheet2_5" class="fader_sheets"> <div class="white_bg"> </div> </div> <div id="sheet2_6" class="fader_sheets"> <div class="white_bg"> </div> </div> <div id="sheet2_7" class="fader_sheets"> <div class="white_bg"> </div> </div> </div> </div> </div> <div id="background"></div> </body> </html>
  10. I've been working on a project here oplinfo.hj.cx/insert_test.php When a user is adding a game and it's compatibly information to the database, I'm able to make check boxes and radio button selections mandatory, as well as specify the min/max characters for a text field. <script Language="Javascript"> <!-- function CheckGameCode() { // Check the length of the value of the element named text_name // from the form named form_name if it's < 10 and > 10 characters // display a message asking for different input if ((form1.gamecode.value.length < 10) || (form1.gamecode.value.length > 10)) { // Build alert box message showing how many characters entered mesg = "You have entered " + form1.gamecode.value.length + " character(s) for Game Code\n" mesg = mesg + "Valid Game Code entries are 10 characters.\n" mesg = mesg + "Please verify your input and submit again.\n" mesg = mesg + "Example: SLUS-12345" alert(mesg); // Place the cursor on the field for revision form1.gamecode.focus(); // return false to stop further processing return (false); } // If text_name is not null continue processing return (true); } --> </script> <script language="Javascript"> function formCheck(formobj){ // Enter name of mandatory fields var fieldRequired = Array("gamename", "gamecode", "region", "comp", "vmc"); // Enter field description to appear in the dialog box var fieldDescription = Array("Game Name", "Game Code", "Region", "Result", "VMC Support"); // dialog message var alertMsg = "Complete the following fields:\n"; var l_Msg = alertMsg.length; for (var i = 0; i < fieldRequired.length; i++){ var obj = formobj.elements[fieldRequired[i]]; if (obj){ switch(obj.type){ case "select-one": if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; case "select-multiple": if (obj.selectedIndex == -1){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; case "text": case "textarea": if (obj.value == "" || obj.value == null){ alertMsg += " - " + fieldDescription[i] + "\n"; } break; default: } if (obj.type == undefined){ var blnchecked = false; for (var j = 0; j < obj.length; j++){ if (obj[j].checked){ blnchecked = true; } } if (!blnchecked){ alertMsg += " - " + fieldDescription[i] + "\n"; } } } } if (alertMsg.length == l_Msg){ return true; }else{ alert(alertMsg); return false; } } </script> and the form <table width="830" border="0" bgcolor="#003131" align="center"><form action="insert_action.php" method="post" name="form1" id="form1" onsubmit="return !!(CheckGameCode() & formCheck(this));"> <tr> <td width="174" height="38" bgcolor="#003a39"><strong> Game Name / Game Code</strong></td> <td width="438" bgcolor="#003a39"> <input name="gamename" type="text" id="" size="40" maxlength="35" /> <input name="gamecode" type="text" id="gamecode" size="10" maxlength="10" /></td> <td width="204" bgcolor="#003a39"> For gamecode: <a href="http://www.sonyindex.com/index.htm">Sony Index</a><br /> Enter using 10 chars: ABCD-12345</td> </tr> Now what I'd like to do is make the "gamecode" text field require a certain character such as "-", rather then only requiring 10 characters.. more specifically, I'd like the first 4 characters required to be a letter (A-Z), the 5th character to be a "-" and the last 5 to be integers.. else the form does not submit. I'd like to eventually use these gamecodes to guarantee no duplicate entries into the database, and also proper format (example: ABCD-12345) if I ever decide to loop and display the row on the web page. The required format would be help against people just typing 10 random characters or using different gamecode format (ABCD_123.45), since duplicate entry validation will depend on the accuracy of these gamecodes. Is this possible with Javascript? If yes, how might I go about implementing these requirements.
  11. I'm using pretty photo. I want to refresh the parent page when I close the modal window which is an iframe. This script closes the modal, but does not refresh the parent frame. <a href="#" onclick="window.parent.jQuery.prettyPhoto.close();">Close</a>
  12. Hello all, I was trying to use PHP to echo a Javascript function but it wasn't going well at all. I am wondering, is it possible to do the following: <script type="text/javascript"><span id="formResponse"></script> Thank you, Josh.
  13. i have a form. if user enter the data, the db table display. but i want the table to get displayed when the user logins for the first time. simple one but i can't get it how... aa.html <html> <body> <script language="javascript" type="text/javascript"> <!-- //Browser Support Code function ajaxFunction(){ var ajaxRequest; // The variable that makes Ajax possible! try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ var ajaxDisplay = document.getElementById('ajaxDiv'); ajaxDisplay.innerHTML = ajaxRequest.responseText; } } var age = document.getElementById('age').value; var wpm = document.getElementById('wpm').value; var sex = document.getElementById('sex').value; var name = document.getElementById('name').value; var queryString = "?age=" + age + "&wpm=" + wpm + "&sex=" + sex + "&name=" + name; $a=ajaxRequest.open("GET", "ss1.php" + queryString, true); ajaxRequest.send(null); } //--> </script> <form name='myForm'> Name:<input type='text' id='name' /> <br /> Age: <input type='text' id='age' /> <br /> WPM: <input type='text' id='wpm' /> <br /> Sex: <select id='sex'> <option value='m'>m</option> <option value='f'>f</option> </select> <input type='button' onclick='ajaxFunction()' value='Insert New row' /> </form> <div id='ajaxDiv'>Your result will display here</div> </body> </html> ss1.php $age = $_GET['age']; $sex = $_GET['sex']; $wpm = $_GET['wpm']; $name= $_GET['name']; // Escape User Input to help prevent SQL Injection $a=isset($_GET['age']) && $_GET['age']; $b=isset($_GET['sex']) && $_GET['sex']; $c=isset($_GET['wpm']) && $_GET['wpm']; $d=isset($_GET['name']) && $_GET['name']; $age = mysql_real_escape_string($age); $sex = mysql_real_escape_string($sex); $wpm = mysql_real_escape_string($wpm); $name = mysql_real_escape_string($name); //build query $query = "INSERT INTO `ajax_example`(`ae_name`, `ae_age`, `ae_sex`, `ae_wpm`) VALUES ('$name','$age','$sex','$wpm')"; $qry = mysql_query($query) or die(mysql_error()); $a="SELECT `ae_name`, `ae_age`, `ae_sex`, `ae_wpm` FROM `ajax_example`"; $qry_result=mysql_query($a) or die(mysql_error()); //Build Result String $display_string = "<table>"; $display_string .= "<tr>"; $display_string .= "<th>Name</th>"; $display_string .= "<th>Age</th>"; $display_string .= "<th>Sex</th>"; $display_string .= "<th>WPM</th>"; $display_string .= "</tr>"; // Insert a new row in the table for each person returned while($row = mysql_fetch_array($qry_result)){ $display_string .= "<tr>"; $display_string .= "<td>$row[ae_name]</td>"; $display_string .= "<td>$row[ae_age]</td>"; $display_string .= "<td>$row[ae_sex]</td>"; $display_string .= "<td>$row[ae_wpm]</td>"; $display_string .= "</tr>"; } $display_string .= "</table>"; echo $display_string; ?> if u could tell me show good websites to practice javascript. woulg b gr8.. thank u in advances.
  14. I have a html form in which the dropdown box is an array element now I have created a javascript function that get form as parameter . 1)I need to maniulate the values of the array present in the form in the below code sendmail is the form sname is the field array function addit(sendmail) { var x=document.sendmail.sname.length; //alert(x); while( x>0 ) { var skill=document.getElementById("sname[x]").value; //alert(skill); var anOption = document.createElement("OPTION"); anOption.innerText = skill; anOption.Value = skill; document.form.snames.options.add(anOption); x--; } }
  15. Hi everyone, I have problem with my accordion menu. Instead of sliding down, content from menu overlap each other...Cut me a little slack because i am new to javascript. This is code for menu. <?php include("script/dblib.php"); connectToDB(); header("Content-Type: text/html; charset=UTF-8"); ?> <HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript" src="script/script.js"></script> <STYLE> #accordion { list-style: none; padding: 0 0 0 0; width: 230px; } #accordion li{ height:45px; line-height:45px; display: block; background-image:url('images/for_css/menu_bg.jpg'); background-repeat:repeat-x repeat-y; font-weight: bold; padding-left: 5px; cursor: pointer; list-style: circle; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; } #accordion ul { list-style: none; padding: 0 0 0 0; display: none; } #accordion li:hover{ background-image:url('images/for_css/bgMenu.png'); } #accordion ul li{ height:30px; text-align: center; font-size: 12px; font-weight: normal; cursor: auto; background-image:url('images/for_css/bc_bg.gif'); line-height:30px; padding: 0 0 0 7px; } #accordion ul li:hover { background-image:url('images/for_css/bgMenu.png'); } #accordion a { text-decoration: none; } </STYLE> </HEAD> <BODY> <?php // Select all entries from the menu table $result=mysql_query("SELECT * FROM parents ORDER BY id_roditelja"); // Create a multidimensional array to conatin a list of items and parents $menu = array( 'items' => array(), 'parents' => array() ); // Builds the array lists with data from the menu table while ($items = mysql_fetch_assoc($result)) { // Creates entry into items array with current menu item id ie. $menu['items'][1] $menu['items'][$items['id_roditelja']] = $items; // Creates entry into parents array. Parents array contains a list of all items with children $menu['parents'][$items['parent_id']][] = $items['id_roditelja']; } // Menu builder function, parentId 0 is the root function buildMenu($parent, $menu) { $html = ""; if (isset($menu['parents'][$parent])) { $html .= " <ul id='accordion'>\n"; foreach ($menu['parents'][$parent] as $itemId) { if(!isset($menu['parents'][$itemId])) { $html .= "<li>\n <a >".$menu['items'][$itemId]['naziv']."</a>\n</li> \n"; } if(isset($menu['parents'][$itemId])) { $html .= " <li>\n <a >".$menu['items'][$itemId]['naziv']."</a> \n"; $html .= buildMenu($itemId, $menu); $html .= "</li> \n"; } } $html .= "</ul> \n"; } return $html; } echo buildMenu(0, $menu); ?> </BODY> </HTML> javascript part: $(document).ready(function(){ $('#accordion > li ul') .click(function(event){ event.stopPropagation(); }) .filter(':not(:first)') .hide(); $('#accordion > li, #accordion > li > ul > li').click(function(){ var selfClick = $(this).find('ul:first').is(':visible'); if(!selfClick) { $(this) .parent() .find('> li ul:visible') .slideToggle(); } $(this) .find('ul:first') .stop(true, true) .slideToggle(); }); }); This is image of what is happening
  16. I'm writing code to validate a form and I'd like to be able to set the position of the cursor to the field of my choice when I detect an error. I'm getting the strong impression that I have to use Javascript to set the position of the cursor via the focus() function. But how do I pass information from my PHP code to Javascript to tell it which field I want the focus on? For example, let's say I've got a simple form contain Name, Email address, Subject and Message. I check for bad data in all of those fields and I want to put the cursor (or focus) on the first field that has an error. How does my PHP code tell Javascript that the first field in error is the Email Address or the Message or whatever? An example showing what happens in PHP and what happens in Javascript would be very handy if someone can point me to one or throw one together....
  17. so is there any way to fetch what array to fetch the data from in the Function input? this is what i got so far function onHoverCounter( ChampID ) { var show1 = ChampID[1]; $("#"+show1).addClass('counter'); } ChampID is fetched from <a href="?champion=ahri"><div class="champion apcarry mid" id="ahri" onmouseover="onHoverCounter(this.id);" onmouseout="onmouseoutCounter(this.id);"><img src="img/champions/ahri.jpg"> Ahri </div></a>
  18. I'm trying to load a listbox named Doggie with this script. It's in the header of my webpage. Can anyone see what I am doing wrong? Thank you. switch(n){ case "Place": $(".Doggie").load(function() $.ajax({ type: "POST", url: "place_place.php", cache: false, success: function (html) { $(".Doggie").html(html); } }); }); break;
  19. I have code that is working. $('.Kitty').live("change",function(){ var LocationString = 'Lid='+ $(this).val(); $.ajax({ type: "POST", url: "ajax_area.php", data: LocationString, cache: false, success: function (html) { $(".Pig").html(html); However; I need two values. Lid (LocationString) and Cid (CityString) How would I do this? I tried this and it doesn't work. $('.Kitty').live("change",function(){ var LocationString = 'Lid='+ $(this).val(); var CityString = 'Cid='+ $(this).val(); $.ajax({ type: "POST", url: "ajax_area.php", data: {Lid: LocationString, Cid:CityString}, cache: false, success: function (html) { $(".Pig").html(html); And this is the ajax_area.php file. Its grabbing Lid successfully, how is Cid added to this mix? <?php require('config.php'); if($_POST['Lid']) { $Lid=$_POST['Lid']; $sql=mysql_query("SELECT tblLocations.RestID as Lid, tblAreas.AreaName as name FROM tblLocations INNER JOIN tblAreas ON tblLocations.AreaID = tblAreas.AreaID WHERE tblLocations.RestID = $Lid GROUP BY tblLocations.RestID, tblAreas.AreaName ORDER BY tblAreas.AreaName ASC"); echo '<option selected="selected">--Select Area--</option>'; while($row=mysql_fetch_array($sql)) { echo '<option value="'.$row['Lid'].'">'.$row['name'].'</option>'; } } ?> Help is appreciated! Thank you!
  20. I made this simple shopping cart where you select quantity from a dropwdown list and these numbers get added and you get a total number for all the products and a total number for the product itself. But i want it write the quantity with price and the name and write it in a div placed on the site so that it is easy for the user to see that he added a product. I made the calculating part by adding the products one by one, as i did not array them. But for this next part i just didn't find a way that suited my needs. This is just from my test page , so i only have a few values , but in the other page i have over 70 listed just like these: <div id="radioAlert"> <script type="text/javascript"> //calculator function updatesum() { document.form.sum.value = (document.form.sum0.value -0) *99 + (document.form.sum1.value -0) *99 + (document.form.sum2.value -0) *99; document.form.smu.value = (document.form.prod0.value -0)*99 + (document.form.prod1.value -0) *99 + (document.form.prod2.value -0) *99 + (document.form.prod3.value -0) *99 + (document.form.prod4.value -0) *99; document.form.totalsum.value = (document.form.sum.value -0) + (document.form.smu.value -0); //not a typo i was just lazy with the name //arrays //This one i did not get to work. var myArray = newArray(); myArray[0]=document.form.sum2.value; myArray[1]=document.form.prod0.value; myArray[2]=document.form.prod1.value; myArray[3]=document.form.prod2.value; myArray[4]=document.form.prod3.value; myArray[5]=document.form.prod4.value; for (var i = 0; i < myArray.length; i++) { alert(myArray[i]); } //this part works but i want it to add its value only once and then replace its value if its updated again, if its 0 i want it to be completely removed. var prod1 = document.form.sum2.value; var prod2 = document.form.sum1.value; var radioAlert = document.getElementById("radioAlert"); var radioAlert2 = document.getElementById("radioAlert"); if (document.form.sum2.value>0) { //document.write("pilotjakke pelsforet small " + prod1 + " stk"); radioAlert.innerHTML += ("pilotjakke pelsforet small " + prod1 + " stk"); alert("pilotjakke pelsforet medium " + prod1 + " stk"); } if (document.form.sum1.value>0) { //document.write("pilotjakke pelsforet small " + prod1 + " stk"); radioAlert2.innerHTML += ("pilotjakke pelsforet medium " + prod2 + " stk"); } } </script> </div>
  21. *I wasnt quite sure what forum to put this at, so since im coding in PHP i posted it here* I am currently creating a League of Legends Champion site where i want it to when i hover over a Champion (Character) i want its counters to get a red/green border (depending on if the champion is good against it or the champion itself is good vs it) So i started using the CSS:hover way, but looking at this i cant help but to notice that it will require a whole lot of code, so im kinda wondering if theres another way of doing it with like Jquery or plain javascript (Maybe even a PHP Function?) I got all the counters stored in a Database Built up as following: CREATE TABLE `counters` ( `Name` TEXT NULL, `Counter 1` TEXT NULL, `Counter 2` TEXT NULL, `Counter 3` TEXT NULL, `Counter 4` TEXT NULL, `Counter 5` TEXT NULL, `Counters 1` TEXT NULL, `Counters 2` TEXT NULL, `Counters 3` TEXT NULL, `Counters 4` TEXT NULL, `Counters 5` TEXT NULL, `Good With 1` TEXT NULL, `Good With 2` TEXT NULL, `Good With 3` TEXT NULL, `Good With 4` TEXT NULL, `Good With 5` TEXT NULL ) i already know how to fetch the data and such, so thats not the problem (just included this if it would be usefull in anyway) But ye, to summarize it im asking if theres another way to do it with Javascript/PHP or anything like that, and also if you would be kind enough to give me a hint about how to do that (i dont need you to write the whole code since i enjoy that myself) but simply a hint on how to do it. And also once again i apologize if this is the wrong part of the forum to put it (move it if needed)
  22. Hello guys, I'm building a website for tablets and i want o add the ability for the user to swipe down to another div. I've found some jquery plugins for this but only for left/right, and from some blogs that jquery doesn't support this ? Is that true and how can i overcome this ? I don't know javascript/jquery and i'd like some help.
  23. Hi, In my project I am calling ul and li data in Iframe and when I click on link then it move fucus on top instead of selected item. Following is the example of the problem. testFrame.htm <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Tree Frame</title> </head> <body> <table width="50%" border="0"> <tr id="frameRow"> <td> <iframe id="treeFrame" src="treeFrame2.htm" width="50%" height="100%" scrolling="yes" frameborder="0"> </iframe> <td> </tr> </table> </body> </html> testFrame2.htm <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Test Frame2</title> <script language="javascript" type="text/javascript"> function focusMe(id) { documentBygetelementsbyid(id).focus(); } </script> </head> <body> <ul> <li><a href="#" id="1" onclick="javascript:focusMe('1');">menu1</a></li> <li><a href="#" id="2" onclick="javascript:focusMe('2');">menu2</a></li> <li><a href="#" id="3" onclick="javascript:focusMe('3');">memnu3</a></li> <li><a href="#" id="4" onclick="javascript:focusMe('4');">menu4</a></li> <li><a href="#" id="5" onclick="javascript:focusMe('5');">menu5</a></li> <li><a href="#" id="6" onclick="javascript:focusMe('6');">menu6</a></li> <li><a href="#" id="7" onclick="javascript:focusMe('7');">menu7</a></li> <li><a href="#" id="8" onclick="javascript:focusMe('8');">menu8</a></li> <li><a href="#" id="9" onclick="javascript:focusMe('9');">menu9</a></li> <li><a href="#" id="10" onclick="javascript:focusMe('10');">menu10</a></li> <li><a href="#" id="11" onclick="javascript:focusMe('11');">menu11</a></li> <li><a href="#" id="12" onclick="javascript:focusMe('12');">menu12</a></li> <li><a href="#" id="13" onclick="javascript:focusMe('13');">menu13</a></li> <li><a href="#" id="14" onclick="javascript:focusMe('14');">menu14</a></li> <li><a href="#" id="15" onclick="javascript:focusMe('15');">menu15</a></li> </ul> </body> </html> Any solution? - Thanks Zohaib.
  24. hi i am new to php and i am working on a form which has to generate a table row on the button click , but my problem is that i don't have any idea to how do i save that incremented textbox value in my databasa . Can anyone help me out please it would be a huge favor. i have attached my my php script and html script along with this message here is my code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd%22>"]http://www.w3.org/TR...nsitional.dtd">[/url] <html xmlns="[url="http://www.w3.org/1999/xhtml%22>"]http://www.w3.org/1999/xhtml">[/url] <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Makhtab</title> <link rel="stylesheet" type="text/css" href="form2/view.css" media="all"> <script type="text/javascript" src="form2/view.js"></script> <script type="text/javascript" src="form2/calendar.js"></script> <meta http-equiv="Content-Script-Type" content="text/javascript"> <script type="text/javascript"> function deleteRow(row) { var i=row.parentNode.parentNode.rowIndex; document.getElementById('POITable').deleteRow(i); } function insRow() { console.log( 'hi'); var x=document.getElementById('POITable'); var new_row = x.rows[1].cloneNode(true); var len = x.rows.length; new_row.cells[0].innerHTML = len; var inp1 = new_row.cells[1].getElementsByTagName('input')[0]; inp1.id += len; inp1.value = ''; var inp2 = new_row.cells[2].getElementsByTagName('input')[0]; inp2.id += len; inp2.value = ''; x.appendChild( new_row ); } </script> <script type="text/javascript"> function deletezimRow(row) { var i=row.parentNode.parentNode.rowIndex; document.getElementById('zimtable').deleteRow(i); } function inszimRow() { console.log( 'hi'); var x=document.getElementById('zimtable'); var new_row = x.rows[1].cloneNode(true); var len = x.rows.length; new_row.cells[0].innerHTML = len; var inp1 = new_row.cells[1].getElementsByTagName('input')[0]; inp1.id += len; inp1.value = ''; var inp2 = new_row.cells[2].getElementsByTagName('input')[0]; inp2.id += len; inp2.value = ''; x.appendChild( new_row ); } </script> <!--<style type="text/css" title="currentStyle"> @import "tran/css/layout-styles.css"; @import "tran/css/themes/smoothness/jquery-ui-1.8.4.custom.css"; </style>--> <script type="text/javascript" src="tran/js/jquery-1.6.1.min.js"></script> <script type="text/javascript" src="tran/js/jquery-ui-1.8.14.custom.min.js"></script> <script type="text/javascript" src="tran/js/jq-ac-script.js"></script> </head> <body id="main_body" > <img id="top" src="form2/top.png" alt=""> <div id="form_container"> <h1><a>Untitled Form</a></h1> <form id="makhtab" class="appnitro" enctype="multipart/form-data" method="post" action="makhproc.php"> <div class="form_description"> <h2>Makhtab Details</h2> <!--<p>This is your form description. Click here to edit.</p>--> </div> <table border="0px" width="100%"> <tr> <td><label class="description" for="element_1">Code</label></td><td><input id="element_1" name="code" class="element text small" type="text" maxlength="6" value=""/></td> </tr> <tr> <td><label class="description" for="element_1">Name</label></td><td><input id="element_1" name="name" class="element text large" type="text" maxlength="40" value=""/> </td> </tr> <tr> <td><label class="description" for="element_1">Address</label></td><td><input id="element_4_1" name="add1" class="element text large" value="" type="text"></td> </tr> <tr> <td></td><td><input id="element_4_1" name="add2" class="element text large" value="" type="text"></td> </tr> <tr> <td></td><td><input id="element_4_1" name="add3" class="element text large" value="" type="text"></td> </tr> <tr> <td><label class="description" for="element_1">City</label></td><td><select name="cmbcity" class="element text medium" style="font-size:18px;"/> <option value=""></option> <?php mysql_connect("localhost", "root", '') or die(mysql_error()); mysql_select_db("webapp") or die(mysql_error()); $result = mysql_query("SELECT `name` from city ") or die(mysql_error()); while ($year = mysql_fetch_array($result)) { echo "<option value='$year[name]'>$year[name]</option>"; } ?> </select> </tr> <tr> <td><label class="description" for="element_1">State</label></td><td><select name="cmbstate" class="element text medium" style="font-size:18px;"/> <option value=""></option> <?php mysql_connect("localhost", "root", '') or die(mysql_error()); mysql_select_db("webapp") or die(mysql_error()); $result = mysql_query("SELECT `name` from state ") or die(mysql_error()); while ($year = mysql_fetch_array($result)) { echo "<option value='$year[name]'>$year[name]</option>"; } ?> </select> </tr> </tr> <tr> <td><label class="description" for="element_1">Country</label></td><td><select name="cmbcountry" class="element text medium" style="font-size:18px;"/> <option value=""></option> <?php mysql_connect("localhost", "root", '') or die(mysql_error()); mysql_select_db("webapp") or die(mysql_error()); $result = mysql_query("SELECT `name` from country ") or die(mysql_error()); while ($year = mysql_fetch_array($result)) { echo "<option value='$year[name]'>$year[name]</option>"; } ?> </select> <tr> <td><label class="description" for="element_1">Telephone</label></td><td><input id="element_1" name="country" class="element text medium" type="text" maxlength="255" value=""/></td> </tr> <tr> <td><label class="description" for="element_1">Mobile</label></td><td><input id="element_1" name="country" class="element text medium" type="text" maxlength="10" value=""/></td> </tr> <tr> <br /> </tr> </table> <tr> <br /><p style="border-bottom: 1px dotted #ccc;"></p><br /> <div class="form_description"> <h2>Zimmedar Details</h2> <!--<p>This is your form description. Click here to edit.</p>--> </div> </tr> <input type="button" id="addmorezimbutton" value="Add zimmedar" onclick="insRow()"/><br/><br/> <table id="zimtable" border="0px" size="100px" cellspacing="0" cellpadding="2"> <tr> <td width="10" align="center"><label class="description">Srno. </label></td> <td width="118"><label class="description">Zimmedar Name</label></td> <td width="118"><label class="description">Mobile</label></td> <td width="10"></td> <td width="10" align="center"></td> </tr> <tr> <td>1</td> <td width="210"><input size="40" maxlenght="40" type="text" id="zimame[]"/></td> <td width="80"><input size="10" maxlenght="10" type="text" id="zimmob[]"/></td> <!--<td><input size="45" maxlenght="10" type="text" id="momob"/> </td>--> <td><input type="button" id="addzimmore" value="+" onclick="inszimRow()"/></td> <td align="center"><input type="button" id="delzimbutton" value="-" onclick="deletezimRow(this)"/></td> </tr> </table> <tr> <br /><p style="border-bottom: 1px dotted #ccc;"></p><br /> <div class="form_description"> <h2>Muallim Details</h2> <!--<p>This is your form description. Click here to edit.</p>--> </div> </tr> <input type="button" id="addmorePOIbutton" value="Add Muallims" onclick="insRow()"/><br/><br/> <table id="POITable" border="0px" size="100px" cellspacing="0" cellpadding="2"> <tr> <td width="10" align="center"><label class="description">Srno. </label></td> <td width="118"><label class="description">Moallim Name</label></td> <td width="118"><label class="description">Mobile</label></td> <td width="118"><label class="description">Qabiliyat</label></td> <td width="10"></td> <td width="10" align="center"></td> </tr> <tr> <td>1</td> <td width="210"><input size="40" maxlenght="40" type="text" id="moname[]"/></td> <td width="80"><input size="10" maxlenght="10" type="text" id="momob[]"/></td> <td><select name="cmbmuallim[]" class="element text large" style="font-size:18px;"/> <option value=""></option> <?php mysql_connect("localhost", "root", '') or die(mysql_error()); mysql_select_db("webapp") or die(mysql_error()); $result = mysql_query("SELECT `name` from qabiliyat ") or die(mysql_error()); while ($year = mysql_fetch_array($result)) { echo "<option value='$year[name]'>$year[name]</option>"; } ?> </select></td> <!--<td><input size="45" maxlenght="10" type="text" id="momob"/> </td>--> <td><input type="button" id="addmore" value="+" onclick="insRow()"/></td> <td align="center"><input type="button" id="delPOIbutton" value="-" onclick="deleteRow(this)"/></td> </tr> </table> <br /><p style="border-bottom: 1px dotted #ccc;"></p><br /> <table border="0px" width="85%"> <tbody><tr> <td width="105"><label class="description">No. of Students</label></td> <td width="65"><input type="text" name=stu" size="5" maxlength="5"></input></td> <td width="105"><label class="description">No. of Batches</label></td><td width="14"><input type="text" name="batch" size="5" maxlength="3"></input></td> </tr> <tr> <input type="submit" name="submit" value="Save"></input> </tr> </tbody> </table> </div> </div> </table> </form> </body> </html> makhtab.php makhproc.php
  25. I am sorry, If I am asking a basic question.. I am working for a project where I need to give a upload and submit option for client. In that client will browse the local path and selects required "EXCEL" file and if they click to submit, then the content should be displayed in the webpage.. these are few codes I went through, but I thought I am not in the right way.. <HTML> <HEAD> <TITLE> PHP File Upload Script </TITLE> </HEAD> <BODY> <?php if( isset($_POST['submit1'])) { // $_FILES is the array auto filled when you upload a file and submit a form. $userfile_name = $_FILES['file1']['name']; // file name $userfile_tmp = $_FILES['file1']['tmp_name']; // actual location $userfile_size = $_FILES['file1']['size']; // file size $userfile_type = $_FILES['file1']['type']; // mime type of file sent by browser. PHP doesn't check it. $userfile_error = $_FILES['file1']['error']; // any error!. get from here // Content uploading. $file_data = ''; if ( !empty($userfile_tmp)) { // We encode the data just to make it more database friendly $file_data = base64_encode(@fread(fopen($userfile_tmp, 'r'), filesize($userfile_tmp))); } switch (true) { // Check error if any case ($userfile_error == UPLOAD_ERR_NO_FILE): case empty($file_data): echo 'You must select a document to upload before you can save this page.'; exit; break; case ($userfile_error == UPLOAD_ERR_INI_SIZE): case ($userfile_error == UPLOAD_ERR_FORM_SIZE): echo 'The document you have attempted to upload is too large.'; break; case ($userfile_error == UPLOAD_ERR_PARTIAL): echo 'An error occured while trying to recieve the file. Please try again.'; break; } if( !empty($userfile_tmp)) { // only MS office and text file is accepted. if( !(($userfile_type=="application/msword") || ($userfile_type=="text/plain") || ($userfile_type=="application/vnd.ms-excel")) ) {echo 'Your File Type is:'. $userfile_type; echo '<br>File type must be text(.txt) or msword(.doc).'; exit; } } echo filesize($userfile_tmp); } echo ?> <form name="profile" method="POST" action="<?php echo $_SERVER['PHP_SELF'] ?>" target="_self" enctype="multipart/form-data" > <P align ="center"><input type="hidden" name="MAX_FILE_SIZE" value="1000000"> <input type="file" name="file1" value="AttachFile" device="files" accept="text/*" tabindex=18 > <input type="submit" name="submit1" value="Submit" /> </P> </form> </BODY> </HTML> from the above code I am getting only file size.. This code will displays the content of excel file but it is a hard coded one, but I need client should select that file and content get displayed in the webpage itself... <?php error_reporting(E_ALL ^ E_NOTICE); require_once 'excel_reader2.php'; $data = new Spreadsheet_Excel_Reader("test.xls"); php echo $data->dump(true,true); ?> Thanks in advance...
×
×
  • Create New...

Important Information

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