Jump to content

ayok

Members
  • Posts

    340
  • Joined

  • Last visited

    Never

Everything posted by ayok

  1. Hi emehrkay, It still doesn't work thanks, ayok
  2. I even cannot target yahoo.com
  3. Hi roopurt, its the same. it doesnt go to delete.php. The problem is, it results the same if I set the window location to yahoo.com, except I did it in html page. thank you, ayok
  4. Sorry, I missed some lines above it <?php $show1 = mysql_query("SELECT * FROM category WHERE id_cat='$id'") or die(mysql_error()); $datakategori = mysql_fetch_array($show1); echo "<H3>$datakategori[name]</H3><br><img align='left' src='../pics/$datakategori[pic]'<br><H5>$datakategori[description](<a href=edit_cat.php?id=$datakategori[id_cat]>edit kategori</a> | <a href=add_cat.php>add kategori</a>)<H5>"; $show = mysql_query("SELECT service.*,category.name FROM service LEFT JOIN category on service.category=category.id_cat WHERE category='$id'") or die(mysql_error()); echo "<table border=0><tr bgcolor='#D0DCE0'><th>Service</th><th>Description</th><th>Duration (minutes)</th><th>Prices</th></tr>"; while (($data = mysql_fetch_array($tampil)) && (mysql_num_rows($tampil) > 0)) { echo "<tr>"; echo "<td bgcolor='#D47FFF'>$data[name_serv]</td>"; echo "<td bgcolor='#FF55FF'>$data[desc_serv]</td>"; echo "<td bgcolor='#D47FFF'>$data[minutes]</td>"; echo "<td bgcolor='#FF55FF'>$data[price]</td>"; echo "<td><a href='' onclick='disp_confirm()'>delete</a><br><a href=edit_service.php?id=$data[id_serv]>edit</a></td></tr>"; } echo "</table>"; }?> <script type="text/javascript"> function disp_confirm(){ var msg = "Do you really want to delete this?"; if (confirm(msg)){ window.location("delete.php?id=$datakategori[id_cat]"); } return false; } </script>
  5. <?php $show = mysql_query("SELECT service.*,category.name FROM service LEFT JOIN category on service.category=category.id_cat WHERE category='$id'") or die(mysql_error()); echo "<table border=0><tr bgcolor='#D0DCE0'><th>Service</th><th>Description</th><th>Duration (minutes)</th><th>Prices</th></tr>"; while (($data = mysql_fetch_array($tampil)) && (mysql_num_rows($tampil) > 0)) { echo "<tr>"; echo "<td bgcolor='#D47FFF'>$data[name_serv]</td>"; echo "<td bgcolor='#FF55FF'>$data[desc_serv]</td>"; echo "<td bgcolor='#D47FFF'>$data[minutes]</td>"; echo "<td bgcolor='#FF55FF'>$data[price]</td>"; echo "<td><a href='' onclick='disp_confirm()'>delete</a><br><a href=edit_service.php?id=$data[id_serv]>edit</a></td></tr>"; } echo "</table>"; }?> <script type="text/javascript"> function disp_confirm(){ var msg = "Do you really want to delete this?"; if (confirm(msg)){ window.location("delete.php?id=$datakategori[id_cat]"); } return false; } </script>
  6. Hi roopurt, After I tried with html page, it works. So I think the problem is that I'm doing it in php script. Is there anyway to use it in php script. Because the item that will be deleted is in php. thank you, ayok
  7. Hi roopurt, It still doesn't work. I try in IE it gives an error: Object doesn't support this action. thanks, ayok
  8. Hi roopurt, I have try the code window.location.href = "http://www.yahoo.com"; . But it doesn't go to yahoo.com. It stays in the same page. thank you, ayok
  9. Hi, So far my javascript is: function disp_confirm(){ var name=confirm("Do you really want to delete this?") if (name==true){ window.location("delete.php?id=$data[id_cat]") } else{ return true; } } and the link where to click: <a href='' onclick='disp_confirm()'>delete</a> The confirm box is popuped but if i click on ok or cancel it will open the index page. Anybody can help me? Thank you, ayok
  10. No.. it doesn't go to yahoo.com. So it goes to empty url.
  11. It goes to index.php.. its an admin folder.. www.myweb.com/admin/ ayok
  12. Thanks roopurt, It seems the javascript is working, but i can't get the url "delete.php?id=$data[id_cat];" Is there any help to correct this? ayok
  13. Hi thanks roopurt, It is return to the page when i click "cancel", but it doesn't delete when i click on "ok". Is there something wrong with the window location? ayok
  14. Hi roopurt, Sorry I don't understand your answer. Could you give me example? ayok
  15. Hi there, I have a question regarding the confirm box of javascript. I'd like to pop up a confirm box when the admin wants to delete an item. So when the person click on "ok", the item will be delete, but if "cancel" is clicked, then it would stay on this page. But I cannot get it works. I've tried this script: <script type="text/javascript"> function disp_confirm(){ var name=confirm("You're going to delete this item, would you like to process it?") if (name==true){ window.location("delete.php?id=$data[id_cat];") } } </script> And this code on the delete: <a href='' onclick='disp_confirm()'>delete</a> Could anybody help me with this? Thank you, ayok
  16. ayok

    Google Map

    Hi, Recently I've seen a lot of websites which show a map to show locations, and some are from google map. I wonder how to make that. Could anybody tell me how? Thank you, ayok
  17. Hi, I have a question. I use dreamweaver to make a website, and we can make pop up windows with it by adding behavior. It will automaticly add this script <script type="text/JavaScript"> <!-- function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //--> </script> However, when no thumb appears when we rollover on the link that will pop up a window. It makes the visitor doesn't notice that there is a link on that. Thus, my question is, how to make the thumb appears on the link? (like normal links) Thank you, ayok
  18. ayok

    image upload

    Wow.. it works.. you're just great. Thank you very much! Cheers, ayok
  19. ayok

    image upload

    the script works fine in localhost, but when I tried in my webserver, i got this error: "Allowed memory size of 8388608 bytes exhausted (tried to allocate 6400 bytes) " Why is that? thanks, ayok
  20. OMG... Barand... it's true.. You're the super genius.. You safe me! Thank you very much! Love this forum cheers, ayok
  21. It seems like this line for($x = 0 ; $x < mysql_num_rows($category) ; $x++){ doesn't work.
  22. ayok

    image upload

    <?php session_start(); if(!empty($namauser) AND !empty ($passuser)) { include "../dbconnect.php"; echo "<H3 align=center>Add Picture</H3> <FORM enctype=MULTIPART/FORM-DATA METHOD=POST ACTION=input_pic.php> <table align=center border=0> <tr><td>Title: </td> <td><INPUT TYPE=TEXT SIZE=60 NAME= title></td></tr> <tr><td>Category: </td> <td><SELECT NAME=category> <OPTION VALUE=0 SELECTED>--Choose Category--"; $tampil=mysql_query("SELECT * FROM category ORDER BY id"); while($data=mysql_fetch_array($tampil)) { echo "<OPTION VALUE=$data[id]>$data[name]"; } echo "</OPTION></SELECT></td></tr> <tr><td>Upload:</td> <td> <input type=file name=fupload></td></tr> </table> <INPUT TYPE=SUBMIT VALUE=Add> </FORM><a href=foto2.php>Show and delete pictures</a><BR> <a href=logout.php>logout</a>"; }else{ echo "You have to login before adding new items<BR>"; echo "<a href=form_login.php>Login</a>"; } ?> <style type="text/css"> <!-- body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; } body { background-color: #993300; } a { font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #00FF00; font-weight: bold; } a:link { text-decoration: none; } a:visited { text-decoration: none; color: #FFFF00; } a:hover { text-decoration: underline; color: #FFFFFF; } a:active { text-decoration: none; } --> </style>
  23. There are two tables. One is pictures table, and the other is category table. On the xml I want to get the pictures are shown per category. So it should look like: <gallery name="Category1"> <image source="pics/original/118.jpg" thumb="pics/118.jpg" title="first pic"/> <image source="pics/original/121.jpg" thumb="pics/121.jpg" title="second pic"/> </gallery> <gallery name="Category2"> <image source="pics/original/122.jpg" thumb="pics/118.jpg" title="third pic"/> <image source="pics/original/123.jpg" thumb="pics/121.jpg" title="forth pic"/> <image source="pics/original/124.jpg" thumb="pics/122.jpg" title="fifth pic"/> </gallery> <gallery name="Category3"> <image source="pics/original/125.jpg" thumb="pics/118.jpg" title="sixth pic"/> <image source="pics/original/126.jpg" thumb="pics/121.jpg" title="seventh pic"/> <image source="pics/original/127.jpg" thumb="pics/122.jpg" title="eight pic"/> </gallery>
  24. ayok

    image upload

    I see.. Thanks MadTechie, it works now. However, I still have a question regarding uploading image. The script is working on localhost with IE. It uploads and resizes the picture, but if I test on Opera, it's not uploaded. Do you know why? Thanks, ayok
  25. Thanks for the reply Barand, I try to correct the script. <?php header("Content-type: text/xml"); include "dbconnect.php"; $category = mysql_query("SELECT id,name FROM category ORDER BY id") or DIE(mysql_error()); $xml_output .= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; $xml_output .= "<menu>\n"; for($x = 0 ; $x < mysql_num_rows($category) ; $x++){ $row = mysql_fetch_assoc($category); $row['name'] = str_replace("&", "&", $row['name']); $row['name'] = str_replace("<", "<", $row['name']); $row['name'] = str_replace(">", ">", $row['name']); $row['name'] = str_replace("\"", """, $row['name']); $xml_output .= "<gallery name=\"" .$row['name']."\">\n"; $pictures = mysql_query("SELECT pictures.*,category.id FROM pictures,category WHERE pictures.category=category.id") or DIE(mysql_error()); for($x = 0 ; $x < mysql_num_rows($pictures) ; $x++){ $row2 = mysql_fetch_assoc($pictures); $xml_output .= "\t<image source=\"original/" .$row2['image']."\""; $xml_output .= "\tthumb=\"" .$row2['image']."\""; $row2['title'] = str_replace("&", "&", $row2['title']); $row2['title'] = str_replace("<", "<", $row2['title']); $row2['title'] = str_replace(">", ">", $row2['title']); $row2['title'] = str_replace("\"", """, $row2['title']); $xml_output .= "\ttitle=\"" .$row2['title']."\"/>\n"; } $xml_output .= "</gallery>\n"; } $xml_output .= "</menu>\n"; echo $xml_output; ?> But i keep getting wrong result. Could you tell me where I do wrong?
×
×
  • 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.