Jump to content

FireDrake

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Everything posted by FireDrake

  1. Between <head> and </head> <style type="text/css"> #blue a:link { color: blue; } #blue a:visited { color: blue; text-decoration: underline; } #blue a:hover { color: yellow; text-decoration: underline; } </style> Somewhere between <body>, <table>, <tr> and </tr>, </table>, </body> <td id="blue" width="33%"> <a href="#">bla bla bla</a> </td>
  2. use the [ code ] [ /code ] tags plz -.- And what's it suposed to do?
  3. Did the database update? I think you can better use AJAX to reach what you try to do. add to the JavaScript part: function GetXmlHttpObject( handler ) { var objXmlHttp = null; if (navigator.userAgent.indexOf("Opera") >= 0) { alert ("Opera wordt niet ondersteund. Gebruik Firefox."); return; } if (navigator.userAgent.indexOf("MSIE") >= 0) { var strName = "Msxml2.XMLHTTP" if (navigator.appVersion.indexOf("MSIE 5.5") >= 0) { strName = "Microsoft.XMLHTTP"; } try { objXmlHttp = new ActiveXObject(strName) objXmlHttp.onreadystatechange = handler; return objXmlHttp; } catch(e) { alert("Error. Scripting for ActiveX might be disabled"); return; } } if (navigator.userAgent.indexOf("Mozilla") >= 0 ) { objXmlHttp = new XMLHttpRequest(); objXmlHttp.onload = handler; objXmlHttp.onerror = handler; return objXmlHttp; } } function UpdateCart(page, id, user, order) { url = page + "?rnd=" + Math.random() + "&id=" + id + "&update=1&user=" + user + "&order=" + order; xmlHttp = GetXmlHttpObject( CartUpdated ); xmlHttp.open("GET", url , true); xmlHttp.send( null ); } function CartUpdated() { if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") { if ( xmlHttp.status == 200 ) { document.getElementById('UpdateSpan').innerHTML = xmlHttp.responseText; } else alert ( xmlHttp.statusText ); } } function ConfirmUpdate(page, id, user, order){ var message = confirm('Are you sure you want to empty your cart?'); if (message){ UpdateCart(page, id, user, order); } else { alert('Ok, nothing will happen, calm down!'); } } This way (with confirmation popup window) wil probably not work, but it's worth the try.. Button: <?php echo " <a href=\"http://www.dmcpublisher.com/shopping/edit~qty.php?id=".$row[book]."\" onclick=\"NewWindow(this.href,'mywin','200','180','no','center'); return false\" onfocus=\"this.blur()\"> <img border='0' src='../images/edit.JPG' width='18' height='18' alt='Edit QTY'> </a><span id=\"UpdateSpan\"> </span>" ?> Popup window: <?php session_start(); $user = $_SESSION['authen']; $order = $_SESSION['thisorder']; $id = $_GET['id'] include('../CMS/operations.inc.php'); //Never use the <font> tags... echo "<p align='center'> <font face='Tahoma'> <span style='font-size: 10pt'>Are you sure you want to empty your cart?</span> </font> </p> <p align='center'> <font face='Tahoma' size='2'> <font color='#FF0000'> <a href='#' onclick=\"UpdateCart('empty~cart~save.php', '".$id."', '".$user."', '".$order."')\"> <font color='#FF0000'>yes</font> </a> </font> <font color='#008000'> <font color='#008000'> <a href=\"javascript:window.close();\">NO</a> </font> </font> </font> </p>"; ?> In the Popup where it updates the cart in the database (the Ajax part links to that page): <?php if (isset($_GET['update']){ $user = $_GET['user']; $order = $_SESSION['order']; include('../CMS/operations.inc.php'); mysql_query("SET CHARACTER_SET_RESULTS=NULL"); $query = "DELETE from `orders` WHERE `orderno` = ".$order." AND `member` = ".$user; $result = mysql_query($query); //change the order status to C ==> canceled $query = "update `ordersmaster` SET `status` = 'C' WHERE `orderno` = ".$order." AND `member` = ".$user; $result = mysql_query($query); echo '<meta http-equiv="refresh" content="0">'; } ?> _________________________ OR: Button: <?php session_start(); $user = $_SESSION['authen']; $order = $_SESSION['thisorder']; $id = $row[book]; echo " <a href='#' onclick=\"ConfirmUpdate('empty~cart~save.php', '".$id."', '".$user."', '".$order."')\" onfocus=\"this.blur()\"> <img border='0' src='../images/edit.JPG' width='18' height='18' alt='Edit QTY'> </a><span id=\"UpdateSpan\"> </span>" ?> No Popup window.. none Place where it updates the cart in the database (the Ajax part links to that page): <?php if (isset($_GET['update']){ $user = $_GET['user']; $order = $_GET['order']; include('../CMS/operations.inc.php'); mysql_query("SET CHARACTER_SET_RESULTS=NULL"); $query = "DELETE from `orders` WHERE `orderno` = ".$order." AND `member` = ".$user; $result = mysql_query($query); //change the order status to C ==> canceled $query = "update `ordersmaster` SET `status` = 'C' WHERE `orderno` = ".$order." AND `member` = ".$user; $result = mysql_query($query); echo '<meta http-equiv="refresh" content="0">'; } ?> It might be buggy (changed everything without trying), but if you read the code, and know how it works, I'm sure you can make it work.
  4. Solved. It's some solution I didn't want to use, but okay.. Changed code for the CSS: .SwitchForm { border: black 1px solid; border-bottom: 0; margin: 0px; width: 200px; float: left; /*padding: 4px;*/ position: relative; } #LinkPg { z-index: 3; background-color: #676767; text-align: center; height: 25px; _top: 5px; } #LinkLb { z-index: 2; right: 40px; background-color: #1F1F1F; text-align: center; height: 20px; top: 5px; _top: 10px; } #LinkVt { z-index: 1; right: 80px; background-color: #1F1F1F; text-align: center; height: 20px; top: 5px; _top: 10px; } .SwitchForm a:link { color: white; } .SwitchForm a:visited { color: white; } .SwitchForm a:hover { color: white; text-decoration: underline; } .SwitchForm a:active { color: white; } Changed JavaScript part: var PersoonsGegevens; var LinkPg; var Lichaamsbouw; var LinkLb; var TableComplete; var LinkVt; var ie = 0; if (document.all){ ie = 1; } function NextPage() { PersoonsGegevens = document.getElementById("TablePersoonsGegevens"); LinkPg = document.getElementById("LinkPg"); Lichaamsbouw = document.getElementById("TableLichaamsbouw"); LinkLb = document.getElementById("LinkLb"); TableComplete = document.getElementById("TableComplete"); LinkVt = document.getElementById("LinkVt"); PersoonsGegevens.style.display = 'none'; Lichaamsbouw.style.display = ''; TableComplete.style.display = 'none'; LinkPg.style.zIndex = '2'; LinkLb.style.zIndex = '3'; LinkVt.style.zIndex = '1'; LinkPg.style.height = '20px'; LinkLb.style.height = '25px'; LinkVt.style.height = '20px'; if (ie == 1){ LinkPg.style.top = '10px'; LinkLb.style.top = '5px'; LinkVt.style.top = '10px'; } else { LinkPg.style.top = '5px'; LinkLb.style.top = '0px'; LinkVt.style.top = '5px'; } LinkPg.style.backgroundColor = '#1F1F1F'; LinkLb.style.backgroundColor = '#676767'; LinkVt.style.backgroundColor = '#1F1F1F'; }
  5. I'll give the code some structure first.. JavaScript in header: <script language="javascript" type="text/javascript"> <!-- /**************************************************** Author: Eric King Url: http://redrival.com/eak/index.shtml This script is free to use as long as this info is left in Featured on Dynamic Drive script library (http://www.dynamicdrive.com) ****************************************************/ var win=null; function NewWindow(mypage,myname,w,h,scroll,pos){ if(pos=="random"){ LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100; TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100; } if(pos=="center"){ LeftPosition=(screen.width)?(screen.width-w)/2:100; TopPosition=(screen.height)?(screen.height-h)/2:100; } else if((pos!="center" && pos!="random") || pos==null){ LeftPosition=0; TopPosition=20; } settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=no'; win=window.open(mypage,myname,settings); } // --> </script> Popup button: <?php echo " <a href=\"http://www.dmcpublisher.com/shopping/edit~qty.php?id=".$row[book]."\" onclick=\"NewWindow(this.href,'mywin','200','180','no','center'); return false\" onfocus=\"this.blur()\"> <img border='0' src='../images/edit.JPG' width='18' height='18' alt='Edit QTY'> </a>" ?> This popup code: <?php session_start(); $user = $_SESSION['authen']; $order = $_SESSION['thisorder']; include('../CMS/operations.inc.php'); //Never use the <font> tags... echo "<p align='center'> <font face='Tahoma'> <span style='font-size: 10pt'>Are you sure you want to empty your cart?</span> </font> </p> <p align='center'> <font face='Tahoma' size='2'> <font color='#FF0000'> <a href='empty~cart~save.php?id=$id'> <font color='#FF0000'>yes</font> </a> </font> <font color='#008000'> <font color='#008000'> <a href=\"javascript:window.close();\">NO</a> </font> </font> </font> </p>"; ?> Code where it updates the qty: <?php session_start(); $user = $_SESSION['authen']; $order = $_SESSION['thisorder']; include('../CMS/operations.inc.php'); mysql_query("SET CHARACTER_SET_RESULTS=NULL"); $query = "DELETE from `orders` WHERE `orderno` = ".$order." AND `member` = ".$user; $result = mysql_query($query); //change the order status to C ==> canceled $query = "update `ordersmaster` SET `status` = 'C' WHERE `orderno` = ".$order." AND `member` = ".$user; $result = mysql_query($query); if (isset($query)) header("Location: http://www.dmcpublisher.com/shopping/cart.php"); echo "<SCRIPT LANGUAGE=\"JavaScript\"> <!--hide window.close(); //--> </SCRIPT> "; ?> I added session_start(); where it updates the qty, and at the popup (don't know if it was anywhere else) Also, add an exit(); before the header, so you can see what the error is. example: <?php session_start(); $user = $_SESSION['authen']; $order = $_SESSION['thisorder']; include('../CMS/operations.inc.php'); mysql_query("SET CHARACTER_SET_RESULTS=NULL"); $query = "DELETE from `orders` WHERE `orderno` = ".$order." AND `member` = ".$user; $result = mysql_query($query); //change the order status to C ==> canceled $query = "update `ordersmaster` SET `status` = 'C' WHERE `orderno` = ".$order." AND `member` = ".$user; $result = mysql_query($query); //add exit, so the script won't continue, and you can see what the error is exit(); if (isset($query)) header("Location: http://www.dmcpublisher.com/shopping/cart.php"); echo "<SCRIPT LANGUAGE=\"JavaScript\"> <!--hide window.close(); //--> </SCRIPT> "; ?> You can also add: <?php echo $user."<br />"; echo $order; ?> To see if they are not empty..
  6. Your code should be less hard to read if you add some structure: <!-- JavaScript should be in the header --> <head> <script type="text/language"> function set_cookie(object, value) { if (value == 'off') { var message = 'off'; } else { var message = 'on'; } if(confirm(message)) { var expireDate = new Date(); var expstring = expireDate.setDate(expireDate.getDate() + 500); document.cookie = object + '=' + value + '; expires = ' + expireDate.toGMTString() + '; path=/'; window.location.reload(); } } </script> </head> <body> <a href="javascript:void(0);" onclick="set_cookie('customize', 'on')">Dont show this message again</a> </body>
  7. It's at the bottom of my first post EDIT: I requested a mod to remove the link, so I'll send you a PM
  8. What didn't work? What is the error? Also, you should make your PHP parts in queries like this: $query = "update `ordersmaster` SET `status` = 'C' WHERE `orderno` = ".$order." AND `member` = ".$user; If the error was "headers already send", add 'ob_start()' at the top of your page and 'ob_end_flush()' at the bottom. 'Header' should be without capital..
  9. I had both <script language="javascript" type="text/javascript">, and deleted the language one. It didn't work though. I always try to use validated HTML, so it shouldn't be something like that. The Doctype is defined, so it can't be anything with that either. Any other suggestions please?
  10. Hey all, I have three different div's, they look like this: <div onclick="PreviousPage()" id="LinkPg" class="SwitchForm"> <a href="javascript:void(0);">Persoonsgegevens</a> </div> <div onclick="NextPage()" id="LinkLb" class="SwitchForm"> <a href="javascript:void(0);">Lichaamsbouw</a> </div> <div onclick="PreComplete()" id="LinkVt" class="SwitchForm"> <a href="javascript:void(0);">Voltooien</a> </div> These three different div's makes an horizontal menu of a form. The css part below: .SwitchForm{ border: black 1px solid; border-bottom: 0; margin: 0px; width: 200px; float: left; padding: 4px; position: relative; } #LinkPg{ z-index: 3; background-color: #676767; text-align: center; height: 25px; } #LinkLb{ z-index: 2; right: 50px; background-color: #1F1F1F; text-align: center; height: 20px; top: 5px; } #LinkVt{ z-index: 1; right: 100px; background-color: #1F1F1F; text-align: center; height: 20px; top: 5px; } .SwitchForm a:link{ color: white; } .SwitchForm a:visited{ color: white; } .SwitchForm a:hover{ color: white; text-decoration: underline; } .SwitchForm a:active{ color: white; } Whenever someone clicks one of the three div's, JavaScript will make sure that other content will be visible, and the old content wil be hidden. The JavaScript part for each div looks like this: function NextPage() { var PersoonsGegevens = document.getElementById("TablePersoonsGegevens"); var LinkPg = document.getElementById("LinkPg"); var Lichaamsbouw = document.getElementById("TableLichaamsbouw"); var LinkLb = document.getElementById("LinkLb"); var PreComplete = document.getElementById("PreComplete"); var LinkVt = document.getElementById("LinkVt"); PersoonsGegevens.style.display = 'none'; Lichaamsbouw.style.display = ''; PreComplete.style.display = 'none'; LinkPg.style.zIndex = '2'; LinkLb.style.zIndex = '3'; LinkVt.style.zIndex = '1'; LinkPg.style.height = '20px'; LinkLb.style.height = '25px'; LinkVt.style.height = '20px'; LinkPg.style.top = '5px'; LinkLb.style.top = '0px'; LinkVt.style.top = '5px'; LinkPg.style.backgroundColor = '#1F1F1F'; LinkLb.style.backgroundColor = '#676767'; LinkVt.style.backgroundColor = '#1F1F1F'; } This works in FF, but IE has some problems with the padding, or height. Example below: *link removed by request of poster* Does anyone know how to make this ie-compatible? Thanks!
  11. thanks, I'll change all of my query's right away I still had to do different names for my $var 's because I had already a $query, $result and $rij in the while loop, so I had to change the ones IN the while loop to $query1, etc. Thanks for helping me
  12. nvm, solved, I had to change the second $query, $result and $rij to $query1, $result1, $rij1 and change the query from $query = "SELECT * FROM link WHERE lid ='$rij['poll_ant']'"; to $query = "SELECT * FROM link WHERE lid ='".$rij['poll_ant']."'"; tnx to daukan for the query change
  13. doh thats a stupid mistake Thanks for finding it =) - solved
  14. I tried to get something out of a database while the loop is still on, so i have a table with links called link(lid, link, image) I'm using a mysql query in a: while ($row = $query){ $row = $some other query to get the links out of the other table }, But ill get an error when I do so: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:\Program Files\wamp\www\Index.php on line 1739 Here is the code, please have a look at it (only posting the while part) while ($rij = mysql_fetch_array ($result)) { echo "<br /><br /><table><tr><td>Nummer ".$nummer.": <tr /><td><b>Wedstrijd nummer: </b><td><b>".$rij ['poll_ant']."</b>"; $query = "SELECT * FROM link WHERE lid ='$rij ['poll_ant']'"; $result = mysql_query ($query); $rij = mysql_fetch_array ($result); echo "<tr><td><a href=".$rij ['link'].">Bekijk wedstrijd</a><tr></table>"; $nummer++; } as you can see, I use $rij ['link'] out of the link table, and the lid (link id) should be $rij ['poll_ant'] out of the other table. anyway to solve this in php or mysql way?
  15. thanks, that solves one of my problems =) and btw that site is very nice, im reading it to solve further problems of the same kind in the future the next thing was that I tried to get something out of a database while the loop is still on, so i have a table with links called link(lid, link, image) I'm using a mysql query in a: while ($row = $query){ $row = $some other query to get the links out of the other table }, But ill get an error when I do so: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:\Program Files\wamp\www\Index.php on line * Here is the code again, please have a look at it (only posting the while part) while ($rij = mysql_fetch_array ($result)) { echo "<br /><br /><table><tr><td>Nummer ".$nummer.": <tr /><td><b>Wedstrijd nummer: </b><td><b>".$rij ['poll_ant']."</b>"; $query = "SELECT * FROM link WHERE lid ='$rij ['poll_ant']'"; $result = mysql_query ($query); $rij = mysql_fetch_array ($result); echo "<tr><td><a href=".$rij ['link'].">Bekijk wedstrijd</a><tr></table>"; $nummer++; }
  16. I have 15 answers in the poll, and all of them are valued as numbers (1-15) thats what I meant by each kind say that 13 people voted on number 3, 11 on number 1 and 6 on number 8. Now i want to show number 3 in first, number 1 on second, and number 8 on third, because its a top 3, but it shows just the first three records in my table, because i don't have anything that can count all of the same numbers (example 13 of number 3) in the database, and i realy don't know how to.
  17. uhm do <?php $url ?> instead of only <? $url ?> maybe that works at least that was one of my problems some time ago, if that wont work, what is the error?
  18. hi, in my code, im trying to get the poll answers out of my database. Poeple have voted in the poll, their answers are in the database table named poll_ip(id, ip, poll_ant = answer), and now I want to make a top 3 out of that. I think I was thinking to complicated when I was trying to make that top 3, bcuz I am selecting everything from poll_ip, order it by poll_ant descending and limit it 0,3. Then I make a loop with while. Anyway, when I output this, I have indeed everything descended, but i wanted only one answer of each kind. I know I have to add some row to my table with count, but I really don't know how to use that. The next thing I tried, was getting the link to one of the top3 out of the database, from another table called link(lid, link, image). I tried to have the link id (lid) the same as poll_ant but that didn't work. Can anyone please help me getting the top3 part up? I need to finish this 4 school.. Here is the part of that code: case "top3": echo "<span>De wedstrijden in de top 3!</span>"; echo"</div>"; echo"<div class=\"stream-ads\">"; echo"<div class=\"ads\">"; echo"<img src=\"/goal.jpg\">"; echo"<div class=\"c pt\">"; echo"</div>"; echo"</div>"; echo"<div class=\"stream\">"; $query = "SELECT * FROM poll_ip ORDER BY poll_ant DESC LIMIT 0,3"; $result = mysql_query ($query); $nummer = 1; echo "<br/><br/><br/></div><br/><div class=\"stream2\">"; echo "<center><table><tr><td>"; while ($rij = mysql_fetch_array ($result)) { echo "<br /><br /><table><tr><td>Nummer ".$nummer.": <tr /><td><b>Wedstrijd nummer:</b><td><b>".$rij ['poll_ant']."</b>"; $query = "SELECT * FROM link WHERE lid ='$rij ['poll_ant']'"; $result = mysql_query ($query); $rij = mysql_fetch_array ($result); echo "<tr><td><a href=".$rij ['link'].">Bekijk wedstrijd</a><tr></table>"; $nummer++; } echo "</td></tr></table></center>"; break;
  19. that one still doesn't work, but I found the problem.. It could not connect to any port, because the variable was wrong.. it was RS_port, not rs_port That was a stupid mistake, but ye thanks anyway =)
  20. Someone asked me to make a status page for RuneScape.. I agreed with that, but when I fill in the form I made, nothing happens. It won't even give me the time out. Please help me The top one works, but the bottom one wont give me any succes. I think i did something wrong with the variables.. <html> <head> <title> RuneScape World Stutus </title> </head> <body bgcolor=black text=white> <?php class RuneScape_World_Status { var $services = array(); var $timeout = 4; var $types = array('tcp', 'udp'); function add_RS_world($name, $ip, $port, $type = 'tcp', $world_status = false, $errno = '', $errstr = '') { $this->services[$name] = array( 'ip' => $ip, 'port' => $port, 'type' => $type, 'status' => $status, 'errno' => $errno, 'errstr' => $errstr ); } function set_world_status($name, $world_status = false) { return $this->services[$name]['world_status'] = $world_status; } function get($name) { if(in_array($this->services[$name]['type'], $this->types)) { $fp = @fsockopen( "{$this->services[$name]['type']}://{$this->services[$name]['ip']}", $this->services[$name]['port'], $this->services[$name]['errno'], $this->services[$name]['errstr'], $this->timeout ); if($fp) { $this->set_world_status($name, true); } else { $this->set_world_status($name); } return $this->services[$name]['world_status']; } } function check() { foreach($this->services as $service => $value) { $this->get($service); } } function world_status($name) { return $this->services[$name]['world_status']; } function debug($var) { echo '<pre>'; print_r($var); echo '</pre>'; } function total_services() { return count($this->services); } function service($name) { return $this->services[$name]; } } ?> <center> <br /><br /><br /> <form name='RSform' method='POST'><table><tr><td> Name of the world: <td><input type='text' name='name' /><tr><td> Link to the world: <td><input type='text' name='worldlink' value='http://' /><tr><td> IP of the world: <td><input type='text' name='worldip' /><tr><td> Port of RuneScape: <td><input type='text' name='port' value='43594' /> (43594 or 43595)<tr><td></table> <input type='submit' name='submit' value='check status'> </form> </center> <?php if (isset ($_POST['submit'])) { $RS_name = ($_POST['name']); $RS_world_link = ($_POST['worldlink']); $RS_world_ip = ($_POST['worldip']); $RS_port = ($_POST['port']); $world_status = new RuneScape_World_Status(); $world_status->add_RS_world('RuneScape', '64.90.181.244', '80'); $world_status->add_RS_world(''.$RS_name.'', ''.$RS_world_ip.'', ''.$rs_port.''); $world_status->check(); echo "<br /><br /><br /><br /><center>RuneScape is: "; echo ($world_status->world_status('RuneScape')) ? '<a href=\'http://www.runescape.com/\'><font color=green><b>Online!</b></font></a>' : '<font color=red><b>Offline!</b></font>'; echo "<br /><br /><br /><br />".$RS_name." is: "; echo ($world_status->world_status($RS_name)) ? '<a href='.$RS_world_link.'><font color=green><b>Online!</b></font></a>' : '<a href='.$RS_world_link.'><font color=red><b>Offline!</b></font></a>'; } ?> </center> </body> </html>
  21. oh I didn't knew I had to include that into my form Thanks -- Solved
  22. Hi everyone when I'm on my php index and click "wedstrijden" (an url link), it will go to ~/index.php?link=wedstrijden. Now comes the problem. Within the "case "wedstrijden":" in my php is a form, which will link you to ~/index.php?sport=(chosensport)&sportknop=Bekijk while it has to go to ~/index.php?link=wedstrijden&sport=(chosensport)&sportknop=Bekijk Can some please help me figuring out what this error is :-\ Here is the php part of the code that contains the error(quite long ) <?php echo "<div class=\"alink\" id=\"browsebar2\">"; if (isset ($_GET['link'])){ switch ($_GET['link']) { case "wedstrijden": echo "<span>Welke sporten? Kies uit:</span>"; $query = "select * from sport"; $result = mysql_query($query); echo "<form method=GET name=sportform>"; echo "<select name='sport'>"; while ($rij = mysql_fetch_array($result)) { $sportcode = $rij['scode']; $soms = $rij['soms']; echo "<option value='$sportcode'>".$soms.""; } echo "</select>"; echo "<input type=submit name=sportknop value='Bekijk'></form>"; echo"</div>"; echo"<div class=\"stream-ads\">"; echo"<div class=\"ads\">"; echo"<img src=\"/Goal.jpg\">"; echo"<div class=\"c pt\">"; echo"</div>"; echo"</div>"; echo"<div class=\"stream\">"; if ($_GET['link'] == wedstrijden) { if ($_GET['sport'] == Handbal) { echo "<div><span><span class=\"shadow\">"; echo "<a href=\"/handbal1.jpg\" title=\"Foto van de wedstrijd\"><i>Foto1: </i><img width=\"150\" height=\"113\" src=\"/handbal1.jpg\"/></a></span></span></div>"; echo "<div><span><span class=\"shadow\">"; echo "<a href=\"/handbal2.jpg\" title=\"Foto van de wedstrijd\"><i>Foto2: </i><img width=\"150\" height=\"113\" src=\"/handbal2.jpg\"/></a></span></span></div>"; echo "<div><span><span class=\"shadow\">"; echo "<a href=\"/handbal3.jpg\" title=\"Foto van de wedstrijd\"><i>Foto3: </i><img width=\"150\" height=\"113\" src=\"/handbal3.jpg\"/></a></span></span></div>"; } } echo"<br/><br/><br/></div><br/><div class=\"stream2\">"; $query = "select * from sport"; $result = mysql_query($query); /*while ($rij = mysql_fetch_array($result)) { echo "Sportcode "; echo $rij['scode']; echo " is: <br>"; echo $rij['soms']; echo "<br><br>"; } echo "<form method=GET name=sportform>"; echo "<select name='sport'>"; while ($rij = mysql_fetch_array($result)) { $sportcode = $rij['scode']; $soms = $rij['soms']; echo "<option value='$sportcode'>$soms"; } echo "</select>"; echo "<input type=submit name=sportknop value='Bekijk'></form>";*/ echo "<center><br><br>Gespeelde wedstrijd:<br><br><br><br>"; if (isset ($_GET['sportknop'])) { if ($_GET['sport'] == Handbal) { /*$tabellen = mysql_list_tables ("GOAL!"); $i=2; while ($i < mysql_num_rows($tabellen)) { $t_name[$i] = mysql_tablename ($tabellen, $i); echo $t_name[$i]. "<br>"; $i++; }*/ $query = "SELECT * FROM wedstrijd WHERE wid = '1'"; $result = mysql_query($query); while ($rij = mysql_fetch_array($result)) { echo "<table><tr><td>Wedstrijd nummer: "; echo "<td>".$rij['wid'];echo "<tr><tr><tr><tr>"; echo "<td> Sport: "; echo "<td>".$rij['sport'];echo "<tr><tr><tr><tr>"; echo "<td> Team Thuis: "; echo "<td>".$rij['team'];echo "<tr><tr><tr><tr>"; echo "<td> Tegenstanders: "; echo "<td>".$rij['tegenstander'];echo "<br><tr><tr><tr><tr>"; echo "<td> Datum: "; echo "<td>".$rij['wanneer'];echo "<tr><tr><tr><tr>"; echo "<td> Eindstand: "; echo "<td>".$rij['voor'];echo "-"; echo $rij['tegen'];echo "<tr><tr><tr><tr>"; echo "<td>Team Thuis heeft: "; If ($rij['voor']>$rij['tegen']) { echo "<td>Gewonnen</table>"; } else if ($rij['voor']<$rij['tegen']) { echo "<td>Verloren</table>"; } else { echo "<td>Gelijkgespeeld</table>"; } } } else if ($_GET['sport'] == Voetbal) { $query = "SELECT * FROM wedstrijd WHERE wid = '9'"; $result = mysql_query($query); while ($rij = mysql_fetch_array($result)) { echo "<table><tr><td>Wedstrijd nummer: "; echo "<td>".$rij['wid'];echo "<tr><tr><tr><tr>"; echo "<td> Sport: "; echo "<td>".$rij['sport'];echo "<tr><tr><tr><tr>"; echo "<td> Team Thuis: "; echo "<td>".$rij['team'];echo "<tr><tr><tr><tr>"; echo "<td> Tegenstanders: "; echo "<td>".$rij['tegenstander'];echo "<br><tr><tr><tr><tr>"; echo "<td> Datum: "; echo "<td>".$rij['wanneer'];echo "<tr><tr><tr><tr>"; echo "<td> Eindstand: "; echo "<td>".$rij['voor'];echo "-"; echo $rij['tegen'];echo "<tr><tr><tr><tr>"; echo "<td>Team Thuis heeft: "; If ($rij['voor']>$rij['tegen']) { echo "<td>Gewonnen</table>"; } else if ($rij['voor']<$rij['tegen']) { echo "<td>Verloren</table>"; } else { echo "<td>Gelijkgespeeld</table>"; } } } else if ($_GET['sport'] == Basketbal) { $query = "SELECT * FROM wedstrijd WHERE wid = '4'"; $result = mysql_query($query); while ($rij = mysql_fetch_array($result)) { echo "<table><tr><td>Wedstrijd nummer: "; echo "<td>".$rij['wid'];echo "<tr><tr><tr><tr>"; echo "<td> Sport: "; echo "<td>".$rij['sport'];echo "<tr><tr><tr><tr>"; echo "<td> Team Thuis: "; echo "<td>".$rij['team'];echo "<tr><tr><tr><tr>"; echo "<td> Tegenstanders: "; echo "<td>".$rij['tegenstander'];echo "<br><tr><tr><tr><tr>"; echo "<td> Datum: "; echo "<td>".$rij['wanneer'];echo "<tr><tr><tr><tr>"; echo "<td> Eindstand: "; echo "<td>".$rij['voor'];echo "-"; echo $rij['tegen'];echo "<tr><tr><tr><tr>"; echo "<td>Team Thuis heeft: "; If ($rij['voor']>$rij['tegen']) { echo "<td>Gewonnen</table>"; } else if ($rij['voor']<$rij['tegen']) { echo "<td>Verloren</table>"; } else { echo "<td>Gelijkgespeeld</table>"; } } } else if ($_GET['sport'] == Tennis) { $query = "SELECT * FROM wedstrijd WHERE wid = '5'"; $result = mysql_query($query); while ($rij = mysql_fetch_array($result)) { echo "<table><tr><td>Wedstrijd nummer: "; echo "<td>".$rij['wid'];echo "<tr><tr><tr><tr>"; echo "<td> Sport: "; echo "<td>".$rij['sport'];echo "<tr><tr><tr><tr>"; echo "<td> Team Thuis: "; echo "<td>".$rij['team'];echo "<tr><tr><tr><tr>"; echo "<td> Tegenstanders: "; echo "<td>".$rij['tegenstander'];echo "<br><tr><tr><tr><tr>"; echo "<td> Datum: "; echo "<td>".$rij['wanneer'];echo "<tr><tr><tr><tr>"; echo "<td> Eindstand: "; echo "<td>".$rij['voor'];echo "-"; echo $rij['tegen'];echo "<tr><tr><tr><tr>"; echo "<td>Team Thuis heeft: "; If ($rij['voor']>$rij['tegen']) { echo "<td>Gewonnen</table>"; } else if ($rij['voor']<$rij['tegen']) { echo "<td>Verloren</table>"; } else { echo "<td>Gelijkgespeeld</table>"; } } } else { $sport = ($_GET['sport']); $query = "SELECT * FROM wedstrijd WHERE sport='".$sport."'"; $result = mysql_query($query); while ($rij = mysql_fetch_array($result)) { echo $rij['wid'];echo "<br>"; echo $rij['sport'];echo "<br>"; echo $rij['team'];echo "<br>"; echo $rij['tegenstander'];echo "<br>"; echo $rij['wanneer'];echo "<br>"; echo $rij['voor'];echo "-"; echo $rij['tegen'];echo "<br>"; If ($rij['voor']>$rij['tegen']) { echo "Winnaars<br><br>"; } else if ($rij['voor']<$rij['tegen']) { echo "Verliezers<br><br>"; } else { echo "Gelijkspel<br><br>"; } } } } } } echo "</center>"; //else { die ("<center><br><br><br><br>Er kon geen verbinding worden gemaakt met de Database.<br><b>".mysql_error()."</b></center>"); } mysql_close(); ?> Help please ???
  23. Thank you thank you, I've just learned a few more things I can finaly continue with my site thanks to our genius I'll mark this as solved.
  24. Hi, I've got a few forms with a href in it all on one page. When you click this href, you will go to the page with method='GET' . Later in the script, I use the if (isset ($_GET['name'])). and the user will get the page he asked for. I want to ask how to get these href's to work without using forms. The form I have at this time is: <html> <head> <link rel="stylesheet" type="text/css" href="/css.css"/> <style type="text/css"> form { margin-top: -1em; margin: 0px; padding: 0px; } input { margin: 0px; padding: 0px; } input.hidden { display: none; } </style> </head> <body> <div class="c" style="position:absolute"> <form name="home" method="GET"> <input type=hidden name=link value=home class=hidden> <A href="javascript: document.home.submit()">Home</A> | </form> <form name="wedstrijden" method="GET"> <input type=hidden name=link value=wedstrijden class=hidden> <A href="javascript: document.wedstrijden.submit()">Wedstrijden</A> | </form> <form name="stemmen" method="GET"> <input type=hidden name=link value=stemmen class=hidden> <A href="javascript: document.stemmen.submit()">Stemmen</A> </form> </div> <?php if (isset ($_GET['home'])) { echo "<br /><br />the Page here"; } if (isset ($_GET['wedstrijden'])) { echo "<br /><br /> another page here"; } if (isset ($_GET['stemmen'])) { echo "<br /><br /> another page here"; } else { echo "no page"; } ?> </body> </html> I want the url linking to the right page in first place, and I don't want the forms with a break between each form. Because now all of my hrefs are horizontal instead of vertical next to each other. Can anyone please help me? Im stuck with this script for hours now.
×
×
  • 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.