Jump to content

leon

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

leon's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for your help, but I am afraid that will not solve my problem. My dropdown list will have three steps. Firstly to select a product category: [code] <select name="navigation" size="1" id="navigation" onChange="go()">                   <option value="http://localhost/order.php" >select a category</option>                   <option value="http://localhost/order.php?parent_id=1" <? if($parent==1){ ?> selected="selected" <? }?> >Travertine</option>                   <option>Marble</option>                   <option>Limestone</option>                   <option>Slate</option>                   <option>Mosaics</option>                   <option>Borders</option>                   <option>Bathware</option>                 </select> [/code] and then depending on the selection, the page reloads itself, the names of the products are pulled down from the database: [code] <select name="product_names">                 <option>select a product</option> <?php     if(isset($parent)){ do{?>                 <option> <?php echo "{$data['alt_name']}";} while($data=mysql_fetch_assoc($result)); }?></option>               </select> [/code] And the last step is again depends on the selection of a product name. When a particular product is selected, it is again reloaded ( or should be, I do not know how to do it yet) and with the proper mysql query, its size or images are retrieved. [code] <select name="select3" size="1">                   <option>select size</option>                 </select> [/code] So how can I modify this last step to achieve what I am trying to do? Thanks again...
  2. Hello, I am working on dynamic drop-down lists, but I have some questions,Here is the code: [code] <?php include ('./db/sql.php'); if(isset($_GET['parent_id'])){ $parent=$_GET['parent_id']; $query="SELECT alt_name, image_thumb FROM products             WHERE parent_id='$parent'"; $sql=$query; $result=mysql_query($sql); $row=mysql_num_rows($result); $data=mysql_fetch_assoc($result); if(!$row){ echo "no results found." .mysql_error(); } } ?> ........some html codes //form <td height="5"><form name="order" method="post" target="" action="">           <table width="100%" border="0" cellspacing="0" cellpadding="0">             <tr>               <th width="15" height="10" scope="row"></th>               <td width="116" class="baslik">Select Category</td>               <td width="144"><label>                 <select name="navigation" size="1" id="navigation" onChange="go()">                   <option value="http://localhost/order.php" >select a category</option>                   <option value="http://localhost/order.php?parent_id=1" <? if($parent==1){ ?> selected="selected" <? }?> >Travertine</option>                   <option>Marble</option>                   <option>Limestone</option>                   <option>Slate</option>                   <option>Mosaics</option>                   <option>Borders</option>                   <option>Bathware</option>                 </select>               </label></td>               <td width="294" height="10"></td>             </tr>             <tr>               <th height="10" scope="row"></th>               <td class="baslik"></td>               <td></td>               <td height="10"></td>             </tr>             <tr>               <th height="10" scope="row"></th>               <td class="baslik">Product Name</td>               <td><label>               <select name="select2">                 <option>select a product</option> <?php     if(isset($parent)){ do{?>                 <option> <?php echo "{$data['alt_name']}";} while($data=mysql_fetch_assoc($result)); }?></option>               </select>               </label></td>               <td height="10"></td>             </tr>             <tr>               <th height="10" scope="row"></th>               <td class="baslik"></td>               <td></td>               <td height="10"></td>             </tr>             <tr>               <th height="10" scope="row"></th>               <td class="baslik">Size: (mm) </td>               <td><label>                 <select name="select3" size="1">                   <option>select size</option>                 </select>               </label></td>               <td width="294" height="10"></td>             </tr>             <tr>               <th height="10" scope="row"></th>               <td class="baslik"></td>               <td></td>               <td height="10"></td>             </tr>                         <tr>               <th height="10" scope="row"></th>               <td class="baslik">How many sqm/ item? </td>               <td><label>                 <input name="textfield" type="text" size="15">               </label></td>               <td height="10"></td>             </tr>                         <tr>               <th height="10" scope="row"></th>               <td class="baslik"></td>               <td></td>               <td height="10"></td>             </tr>                         <tr>               <th height="10" scope="row"></th>               <td class="mycss"></td>               <td></td>               <td width="294" height="10"></td>             </tr>             <tr>               <th height="10" scope="row"></th>               <td class="mycss"></td>               <td><div align="center"></div></td>               <td width="294" height="10"></td>             </tr>           </table>         </form></td> [/code] What I am trying to do is, when user selects a product category,(travertine in this code), it retrieves all the product names under that category from the databse (the page is reloaded, I do not wanna use javascript apart from onChange(go)). And then the problem comes, when the user selects a product, I wanna retrieve related info for that product, size, price maybe image. I cannot modify the code because it is a loop as the following. [code] <select name="select2">                 <option>select a product</option> <?php     if(isset($parent)){ do{?>                 <option> <?php echo "{$data['alt_name']}";} while($data=mysql_fetch_assoc($result)); }?></option>               </select> [/code] How can I overcome this problem? Thanks in advance....
  3. Hello, I was trying to insert rollover image script to php. But I dont think it will be easy. can you check this code please? How can it be adjusted? [code] <?php echo "<a href=\"$PHP_SELF?page=$pageNum&product_id={$data['id']}\" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image71','','{data['image_roll']}',1)">"; ?> [/code] Image_roll is the field from the database.
  4. Hello; I am working on pagination and trying to adapt it to my website. But i encountered a problem when displaying to links to the pages.I mean; (Prev 1 2 3 4 ... Next ) part... [code] for($page = 1; $page<= $maxpage; $page++){         if($page == $currentpage){             echo($page." ");         }else{             echo "<a href=\"$PHP_SELF?page=$page&product_id= (($rowsPerPage * ($page-1)) + 1)\">$page</a> ";         } } [/code] What I want to do here is that; I am on the first page and wanna go to the second page, When I click on (2) , I want to see (...php?page=2 &product_id=9) page. I have a variable at the top. ($rowsPerPage=8). But when I hover on (2), the thing I see as a link is: ...php?page=2 &product_id= ((8 * (2-1)) + 1). You know, if the product_id variable is defined, there is no problem. The correct page comes. I can provide the whole code if requested Thanks...
  5. Yes, I think I will go for css rollover image. I realized that it only has a few line codes so that i can manage them efficiently. Thanks for your help. Let me search some examples for rollovers on the Net...
  6. [!--quoteo(post=363046:date=Apr 9 2006, 06:19 PM:name=ToonMariner)--][div class=\'quotetop\']QUOTE(ToonMariner @ Apr 9 2006, 06:19 PM) [snapback]363046[/snapback][/div][div class=\'quotemain\'][!--quotec--] Not wanting to re-invert your wheel but I am a great proponent of accessibility on websites... Have you considered using css to do this? It means no javascript (so it doesn't matters if the visitor has js turned off) and you have an opportunity for visually imparied users to have their screen readers not have to deal with messy img tags!!! take a look at www.regeneratingnb.co.uk and the associated css file (you will have to spend a bit of time if you are not familiar with class and id attributes and how to use them in css) [/quote] Thank you but, before css I need to learn php and mysql efficiently. I just thought it 'd be easier to use javascript for this because dreamweaver generates the code already, but because of my lack of knowledge, it turns into mess. I tried something like this but it doesnt help.By the way where to add script language='javascript' and </script> things while using php. ? [code]<img src="<?php $data['image'] ?> onmouseover=<?php $data['image_roll']; ?>> alt="<?php echo $data['alt']; ?>" width="102" height="80" ....[/code] Wow I liked this forum, everyone tries to help, I'm impressed.Thanks guys.
  7. [!--quoteo(post=363032:date=Apr 9 2006, 05:41 PM:name=Vorotaev)--][div class=\'quotetop\']QUOTE(Vorotaev @ Apr 9 2006, 05:41 PM) [snapback]363032[/snapback][/div][div class=\'quotemain\'][!--quotec--] Technically it's scripting as opposed to programming. He wants to use a basic rollover; the image changes when you put the mouse on it. He wants to do so with PHP and MySQL, however, which isn't possible for the reasons explained by ToonMariner. A rollover with Javascript is as simple as: [code]<img src="pic.jpg" onmouseover="this.src='new.jpg';" onmouseout="this.src='pic.jpg';">[/code] [Fixed the quotes.] [/quote] Thanks for your replies. Actually i want to make my site dynamic with php and mysql, But i have problems with the rollover image.here is the address; [a href=\"http://www.ionicstone.com/tiles.htm\" target=\"_blank\"]http://www.ionicstone.com/tiles.htm[/a]
  8. Hello guys, I am new to php and mysql and i wanna use rollover images on my website. I created the codes for rollover image using dreamweaver but I can not estimate what do i need to do with mysql and php. Basically , I designed an html site using these images and tried to change the <img src> and rollover sections with the php codes but it was not useful. I hope it is clear. Can you help me?
×
×
  • 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.