Jump to content

techker

Members
  • Posts

    812
  • Joined

  • Last visited

Posts posted by techker

  1. so i fanaly found one that maybe has potential!lol

     

    xml and ajax.

     

    it works good but if i add another on the page and changed the get page to fincity2 and the divtag to city2

     

    the both work but when i select the second one it changes the first one.

     

    i will barke down the code:

     

    the xml

     

    <script>
    function getXMLHTTP() { //fuction to return the xml http object
    	var xmlhttp=false;	
    	try{
    		xmlhttp=new XMLHttpRequest();
    	}
    	catch(e)	{		
    		try{			
    			xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
    		}
    		catch(e){
    			try{
    			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    			}
    			catch(e1){
    				xmlhttp=false;
    			}
    		}
    	}
    
    	return xmlhttp;
    }
    
    
    
    function getCity(strURL) {		
    
    	var req = getXMLHTTP();
    
    	if (req) {
    
    		req.onreadystatechange = function() {
    			if (req.readyState == 4) {
    				// only if "OK"
    				if (req.status == 200) {						
    					document.getElementById('citydiv').innerHTML=req.responseText;	
    					(						
    				} else {
    					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
    				}
    			}				
    		}			
    		req.open("GET", strURL, true);
    		req.send(null);
    	}
    
    }
    </script>
    
    
    [code]
    
    and the form
    
    [code=php:0]
    <form method="post" action="" name="form1">
    <table width="60%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="150">Country</td>
        <td  width="150"><select name="country" onChange="getCity('findcity.php?country='+this.value)">
    <option value="">Select Country</option>
    <option value="ABS">ABS</option>
        <option value="ARMS">ARMS</option>
         <option value="LEGS">LEGS</option>
          <option value="SHOULDERS">SHOULDERS</option>
           <option value="CHEST">CHEST</option>
            </select></td>
      </tr>
      <tr style="">
        <td>City</td>
        <td ><div id="citydiv"><select name="city">
    <option>Select City</option>
            </select></div></td>
    

     

    and the reference page for the query is

     

    <? $country=$_REQUEST['country'];
    $link = mysql_connect('localhost', 'openshar_techker', 'techker'); //changet the configuration in required
    if (!$link) {
        die('Could not connect: ' . mysql_error());
    }
    mysql_select_db('openshar_trainerstool');
    $query="select * from $country ";
    $result=mysql_query($query);
    
    ?>
    <select name="city">
    <option>Select City</option>
    <? while($row=mysql_fetch_array($result)) { ?>
    <option value><?=$row['pic']?></option>
    <? } ?>
    </select>
    [/php

  2. hey guys is tehre a way to put a select box on a page that when you select the lets say categorie it refreshe's the form to get the info(mysql) in that category?

     

    i have tryed lots of was some worked but when i trye to put more then one on a page it refreshe's the first and second box..

     

    i have tryed googling javascript event handler

     

    onchange.

     

    but i cant find a page that shows a for with a select box refresh...

  3. ok so this is the box alone

     

    http://webworkout.info/sel.php

     

    ah sorry wrong box..lol

     

    here is the code for the new probleme.i got the dselect part working but now i need to add more of the same on a same page ..but it refresh's the hole page so all the boxes reset.i have tryed changing all to select2,querry2..check it out to see..

     

    <?
    require "config2.php";
    
    $connection = mysql_connect($dbhost, $dbusername, $dbpass);
    	$SelectedDB = mysql_select_db($dbname);
    
    $cat=$_GET['cat'];
    
    ?>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <SCRIPT language=JavaScript>
    function reload(form)
    {
    var val=form.cat.options[form.cat.options.selectedIndex].value; 
    self.location='sel2.php?cat=' + val ;
    }
    
    </script>
    
    
    </head>
    
    <body>
    <form id="cat" name="cat" method="post" action="">
      <label>
      <select  onchange="reload(this.form)" name="cat" id="cat">
      <option value="selected"><? print"$cat" ?></option>
        <option value="ABS">ABS</option>
        <option value="ARMS">ARMS</option>
         <option value="LEGS">LEGS</option>
          <option value="SHOULDERS">SHOULDERS</option>
           <option value="CHEST">CHEST</option>
            
             
      </select>
      </label>
    </form>
    <p>
      <? 
    if(isset($cat) and strlen($cat) > 0){
    $quer=mysql_query("SELECT DISTINCT pic,id FROM $cat" ); 
    }else{$quer=mysql_query("SELECT DISTINCT pic,id FROM $cat "); } 
    
    echo "<select name='subcat'onChange='swapImage()' ><option value=''>Select one</option>";
    while($noticia = mysql_fetch_array($quer)) { 
    if($noticia['pic']==@$cat3){echo "<option selected value='$noticia[pic]'>$noticia[pic]</option>"."<BR>";}
    else{echo  "<option value=/Account/PICS/$cat/$noticia[pic]>$noticia[pic]</option>";}
    }
    echo "</select>";?>
    </p>
    <p> </p>
    <table width="442" height="138" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <th scope="row"><form id="cat2" name="cat2" method="post" action="">
      <label>
      <select  onchange="reload(this.form)" name="cat2" id="cat2">
      <option value="selected"><? print"$cat2" ?></option>
        <option value="ABS">ABS</option>
        <option value="ARMS">ARMS</option>
         <option value="LEGS">LEGS</option>
          <option value="SHOULDERS">SHOULDERS</option>
           <option value="CHEST">CHEST</option>
            
             
      </select>
      </label>
    </form>
    <p>
      <? 
    if(isset($cat2) and strlen($cat2) > 0){
    $quer2=mysql_query("SELECT DISTINCT pic,id FROM $cat2" ); 
    }else{$quer2=mysql_query("SELECT DISTINCT pic,id FROM $cat2 "); } 
    
    echo "<select name='subcat1'onChange='swapImage()' ><option value=''>Select one</option>";
    while($noticia2 = mysql_fetch_array($quer2)) { 
    if($noticia2['pic']==@$cat3){echo "<option selected value='$noticia2[pic]'>$noticia2[pic]</option>"."<BR>";}
    else{echo  "<option value=/Account/PICS/$cat2/$noticia2[pic]>$noticia2[pic]</option>";}
    }
    echo "</select>";?></th>
      </tr>
    </table>
    <p> </p>
    </body>
    </html>
    

    http://webworkout.info/sel2.php

  4. hey guys i got some part of my list boxes good but it does not stay on the selected choise?

     

    it refreshe's the page but it does not stay on the selected choice>?

     

    <?
    require "config2.php";
    
    $connection = mysql_connect($dbhost, $dbusername, $dbpass);
    	$SelectedDB = mysql_select_db($dbname);
    
    $cat=$_GET['cat'];
    
    ?>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <SCRIPT language=JavaScript>
    function reload(form)
    {
    var val=form.cat.options[form.cat.options.selectedIndex].value; 
    self.location='sel.php?cat=' + val ;
    }
    
    </script>
    </head>
    
    <body>
    <form id="cat" name="cat" method="post" action="">
      <label>
      <select  onchange="reload(this.form)" name="cat" id="cat">
        <option value="ABS">ABS</option>
        <option value="ARMS">ARMS</option>
         <option value="LEGS">LEGS</option>
          <option value="SHOULDERS">SHOULDERS</option>
           <option value="CHEST">CHEST</option>
            
             
      </select>
      </label>
    </form>
    
    
    </body>
    </html>
    
    

     

     

  5. hey guys i was wondering on how i can get info from my database from a select box.

     

    like i tryed this with no luck:

     

    <?
    require "config2.php";
    
    $connection = mysql_connect($dbhost, $dbusername, $dbpass);
    	$SelectedDB = mysql_select_db($dbname);
    
    $cat=$_GET['cat'];
    $QQQ1 = mysql_query(" SELECT id, pic  FROM $cat ");
    if(!$QQQ1) die(mysql_error());
    $err = mysql_num_rows($QQQ1);
    if($err == 0) die("No matches met your criteria.");
    ?>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    <form id="form1" name="form1" method="post" action="">
      <label>
      <select  onchange="reload(this.form)" name="cat" id="cat">
        <option value="ABS">ABS</option>
        <option value="ARMS">ARMS</option>
      </select>
      </label>
    </form>
    
    <?
    while ($line = mysql_fetch_array($QQQ1)) {
    echo "<option value=\"$line[id]\">$line[pic] </option>";
    
    }?>
    </body>
    </html>
    
    

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

     

    im shure it's because it is executing the query before i chose the categorie?

  6. this is what i tryed up to now.

     

    <?
    
    $query = "SELECT * FROM clients_graph";
    $result = mysql_query($query)or die(mysql_error());
    
    print "<SELECT name=\"client\">";
    while ($line = mysql_fetch_array($result)) {
    echo "<option value=\"$line[id]\">$line[2]</option>";
    
    }
    //print  "</select>";
    
    
    echo "<img src='/Account/PICS/". $line['2'] ."' border='0'  hight=120/>";
    print  "</select>";
    ?>
    

  7. hey guys i have a databse withe images in it(just the path to the image folder)

     

    i want to make a list menu but instead of the pic name i want the image to show instead?is that possible???

     

    or when you select the name the image apears?that would be better.thx

  8. hey guys i have a script that generates a page with pics on demand.

     

    now it has a grid (that i did ) as background and over it shows litle pics in the squares.

     

    now it works great but when i try to print it only shows the small pics not the background??

  9. i don't know if you know but in that art business there is alot of copy's!ever look for a tattoo before?your fisrt step is google ...

     

    it has nothing to do with

    corporate-riaa-microsoft-fud" bullshit mentality

     

     

    when you pay to have it piss you off when you see other people with it.

     

  10. hey guys i have a gallery that has thumbnails and when you click it takes you to the images.

     

    i need to prevent downloading of that pic?

     

    this is the echo.

     

     

     Code:
    echo '<th scope="row"><a href="/admin/art/'. $row['pic'] .'" target="_blank" > 
    <img src="/admin/imgsize.php?w=60&h=50&img=art/'. $row['pic'] .'" border="0" alt="" /> 
    </a>  
    

     

     

    so it does not load in a page it gets the images in its directory..

     

    --------------------------------------------------------------------------------

     

×
×
  • 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.