Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About peacehunter

  • Rank
  1. I want to make a photo upload progress bar in javascript.But I dont know what is the basic idea of this. I have an idea but it may not be work. The idea isFirstly I will detect how much data is uploaded and what is the total size of that data. Then I will find the percentage of how much data is uploaded . After that I will make a progress bar based on that percentage. Then I will add the url of the photo in database using ajax and php.But the problem is that how can I detect total size , how much data is uploaded of the photo and the url of the uploaded photo in javascript???Plzzzzzzzz give me a suggestion about that problem or give me another suggestion on making upload progress bar in javascript.
  2. Thnxxxxxxxxxxx.........Problem is solved.............
  3. Thnxxx for your reply.But the problem is that "p#text" is because of being a dynamic text, nobody dont know how many texts will be there. If texts are few than alright. But if texts are many then First few lines will be shown at the background.And some text will be gone to the outside of the background,because of height of the "div#transBG" is fixed.So I want to do that , if lines are outside of the background than height of "div#transBG" will be increased. It would be possible if I would put "p#text" into "div#transBG". But after doing that whole text will be transparent.
  4. HI everyone!!!!I am trying to add some dynamic text into a div.And there will be a transparent background in the back of the dynamic text. Html code is like this: <div id="text"> <p id="text"> Some dynamic text </p></div> css code is like this: div#text{ position: absolute; background-color: #fde4e4; opacity:0.4; filter:alpha(opacity=40); top : 30px;left: 30px:}p#text{font-style: italic;} But the problem is ,if I do like this then whole text become transparent.But I want to do transparent only background, not text. Please give me a suggestion about this problem.
  5. I have found this code in google map api docs. I can not use it with html. The code is below: var map = new GMap2(document.getElementById("map_canvas"));var geocoder = new GClientGeocoder();function showAddress(address) { geocoder.getLatLng( address, function(point) { if (!point) { alert(address + " not found"); } else { map.setCenter(point, 13); var marker = new GMarker(point); map.addOverlay(marker); marker.openInfoWindowHtml(address); } } );} I used this html code : <form onsubmit="showAddress(this.address.value)" action="#"> <p> <input type="text" id="address" name="address" size="60"> <input type="submit" value="Go!"/> </p> <div id="map_canvas"></div> </form> Plzzz give me any suggestion about this problem..
  6. I want to add google map on my site using google map api and php. Where I could enter any address to a html form, and google map will display that based on my address which I have entered on a html form.Plzzz give me any suggestion , how to do this.
  7. Thnxxxxxxxxx for your help. The problem is solved .
  8. I have a database which contains users data . Now I have made a class for fetching all data from database. But it brings only one data , not all. Although I have used while loop But it does not work.The code of my class is: <?phpclass own_status{ var $status; var $query; function __construct($id){ $this->query=mysql_query("SELECT * FROM status WHERE sender_id='$id'") or die(mysql_error()); while($row=mysql_fetch_array($this->query)){ $this->status=$row['status']; } } }?> And I made an instance on another page.Code: <?phprequire("class/reg_data.class.php");require_once("class/own_id.class.php");$cookie=$_COOKIE['user'];$data=new reg_data($cookie);$id=$data->id;$status_class=new own_status($id);$status=$status_class->status;echo $status;?> It fetches only one data not all, but dont know why. I am also facing this problem on making components in joomla and codeigniter framework. Plzzzzz give me a solution .........
  9. Thnxxxxxxxx..........The problem is solved...........
  10. Recently I am working with a php class, but I am receiving an error message like this :\ Fatal error: Using $this when not in object context in C:\wamp\www\social network\class\reg_data.class.php on line 10 although I didn't find any error on my code.My code is (file name is: reg_data.class.php): <?phprequire("config.php");class reg_data{ var $query; var $id; var $first_name; var $last_name; function reg($email){ $this->query=mysql_query("SELECT * FROM reg WHERE email='$email'"); $row=mysql_fetch_array($this->query); $this->id=$row['id']; $this->first_name=$row['first_name']; $this->last_name=$row['last_name']; } }?> I could not understand that where is wrong. Plzzzz give me an solution about this problem.
  11. Recently I am trying to make a chat system using jquery and php.....Its a very very simple chat system. But its not good enough.Coz when I load that chat system on my localhost , my pc become slow. Sometime it hangs. I have downloaded some pre made chat system , that was ok.After observed those code I saw that those code was too complex..Please tell me what have I done wrong,and give me an idea to make it better...my code is below ... (OHHHH.....I have forgotten to say that I am new in jquery).... index.html <html><body><center><form action="chat.php" method="post"><h1>Enter your name :</h1><input type="text" name="name" /><input type="submit" value="Submit" /></center></form></body></html> chat.php <?php$name=$_POST['name'];$text="<input type='hidden' value='$name' name='hidden' id='name'/>"; if($name==""){ header("LOCATION:index.htm"); } echo $text;?><script type="text/javascript" src="jquery.js"></script><script type="text/javascript">function on_click(){$(document).ready(function(){var chat=document.getElementById("text").value;var name=document.getElementById("name").value; $.post("insert.php",{"hidden":name,"text":chat}); })}function msg(){$("#msg").load("show_msg.php");}setInterval(msg(),1000)</script><div id="msg"></div><input name="text" type="text" size="40" id="text"/><button id="button" onclick="on_click()">Submit</button> show_msg.php <?php$con=mysql_connect("localhost","root","") or die ("Could not connect");mysql_select_db("chat",$con) or die("Could not select");$query=mysql_query("SELECT *FROM chat_tbl ORDER BY id ") or die("Could not query");while($row=mysql_fetch_array($query)){ $id=$row['id']; $name=htmlspecialchars($row['name'])."</name>"; $msg=htmlspecialchars($row['msg']); echo $id.".".$name." says:".$msg."<br/>";}?> insert.php <?php$con=mysql_connect("localhost","root","") or die ("Could not connect");mysql_select_db("chat",$con) or die("Could not select");$name=$_POST['hidden'];$msg=$_POST['text'];$query=mysql_query("INSERT INTO chat_tbl (`msg`,`name`) VALUES ('$msg','$name')");if(!$query){ echo "Error";}else{ echo "Successfully inserted...";}?>
  12. Actually I have made an photo gallery , which has comment and reply on comment opportunity. Everything is working fine. But I want to make this site more beautiful.So tried to make that, after mouse over on the reply or comment it will change the color. But I have failed. For that reason I have tried this with simple javascript code in php tag. But my aim is to use it in my site. Plzzz give me any suggestion. Here is my site...http://tuhin2008.x10.mx/show_pic.php?pid=26
  13. Recently I have written a javascript code which work is, after over the mouse on a text it will change the color...The code is below... <html><body><script language="javascript">function mouse_over(){ document.getElementById("text").innerHTML="<div style='background-color:green'>Welcome to our photo gallery...</div>"; }function mouse_out(){ document.getElementById("text").innerHTML="Welcome to our photo gallery..."; }</script><h1 id="text" onmouseover="mouse_over()" onmouseout="mouse_out()">Welcome to our photo gallery...</h1></body></html> The code is work fine. But the problem is that when I use this code in php tag , it does not work. That means color not changed...The code is below.. <?php$script= " <html> <body> <script language='javascript'> function mouse_over(){ document.getElementById('text').innerHTML='<div style='background-color:green'> Welcome to our photo gallery.. </div>'; } function mouse_over(){ document.getElementById('text').innerHTML='Welcome to our photo gallery..'; } </script> </body> </html> <b id='text' onmouseover='mouse_over()' onmouseout='mouse_out()'>Welcome to our photo gallery..</b> ";echo $script;?> Plzzz tell me how can I solve this prob...
  • Create New...