Jump to content

light-angel

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Everything posted by light-angel

  1. <?php if($_POST['radio_A/B'] == 'TRUE') { header('location: '.$_POST['radio_A/B']); exit; } ?> <form action="send.php" method="post" enctype="multipart/form-data"><br> Professional:<br><em>Qualifications, memberships, fellowships or affiliations upon which your professional status relies</em> <br><textarea NAME="Professional" ROWS=5 COLS=35></textarea><BR><BR> Higher Education<br><em>Degree/class/university</em> <br><textarea NAME="Higher Education" ROWS=5 COLS=35></textarea><BR><BR> Further Education:<br><em>Diplomas/Certificates</em> <br><textarea NAME="Further Education" ROWS=5 COLS=35></textarea><BR><BR> Secondary Education<br><em>Name and place of school, A and O level subjects/grades,GCSE subjects/grades, other subjects/grades (grades may be omitted if preferred) </em> <br><textarea NAME="Secondary Education" ROWS=5 COLS=35></textarea><BR><BR> Vocational Training:<br><em>Courses, certificates, coaching (including IT)</em> <br><textarea NAME="Vocational Training" ROWS=5 COLS=35></textarea><BR><BR> Computer Literacy<br><em>Software of which you have knowledge or experience, even if there is no qualification</em> <br><textarea NAME="Computer Literacy" ROWS=5 COLS=35></textarea><BR><BR> Languages<br><em>Normally shown only if fluent</em> <br><textarea NAME="Languages" ROWS=5 COLS=35></textarea><BR><BR> <input type="radio" name="radio_A/B" value="TRUE" />I want to answer More Questions!<br /> <input type="submit" value="Continue" /> </form> doing it like that if i select the radio button or not it goes str8 to the send.php but i want it so if its checked goes to the learn1.php and i have got secions saved @ the top of the script
  2. just tryed this <?php if(!empty($_POST["radio_A/B"])) { header('location: $_POST["radio_A/B"]'); exit; } ?> <form action="#" method="post" enctype="multipart/form-data"><br> Professional:<br><em>Qualifications, memberships, fellowships or affiliations upon which your professional status relies</em> <br><textarea NAME="Professional" ROWS=5 COLS=35></textarea><BR><BR> Higher Education<br><em>Degree/class/university</em> <br><textarea NAME="Higher Education" ROWS=5 COLS=35></textarea><BR><BR> Further Education:<br><em>Diplomas/Certificates</em> <br><textarea NAME="Further Education" ROWS=5 COLS=35></textarea><BR><BR> Secondary Education<br><em>Name and place of school, A and O level subjects/grades,GCSE subjects/grades, other subjects/grades (grades may be omitted if preferred) </em> <br><textarea NAME="Secondary Education" ROWS=5 COLS=35></textarea><BR><BR> Vocational Training:<br><em>Courses, certificates, coaching (including IT)</em> <br><textarea NAME="Vocational Training" ROWS=5 COLS=35></textarea><BR><BR> Computer Literacy<br><em>Software of which you have knowledge or experience, even if there is no qualification</em> <br><textarea NAME="Computer Literacy" ROWS=5 COLS=35></textarea><BR><BR> Languages<br><em>Normally shown only if fluent</em> <br><textarea NAME="Languages" ROWS=5 COLS=35></textarea><BR><BR> A<input type="radio" name="radio_A/B" value="pageX.php"> B<input type="radio" name="radio_A/B" value="pageZ.php"> <input type="submit" value="Continue" /> </form> and all it dose is show the pagename with a # after it and not going to the page sorry if im being stupid
  3. so would it be something like this? <script type="text/javascript"> <!-- function goToSite(yn) { if(yn=='yes') { location.href='/email.php'; } else { location.href='/page10.php'; } } //--> </script> <form action="#"> <div> <input type="radio" name="ES" value="yes" onclick="goToSite(this.value)"><label>Yes</label> <input type="radio" name="ES" value="no" onclick="goToSite(this.value)"><label> No</label> </div> </form>
  4. im building a form in php and is their away to have a submit or continue button on the same page so if ya want to fill in more it will go to the next page if not it will e-mail the info
  5. thank you for the help all working well now as for the html structure that is all sorted in the main page and the php&mysql page is just called in by the main page
  6. this is my code but i want to have a pice so if their is no results the it will put in a message like "No Results" but i cant figger it out <?php $host="localhost"; $username="xxxxx"; $password="xxxxxx"; $db_name="xxxxxxx"; $tbl_name="Shows"; // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name WHERE Month='April'and Year='2011' order by Day asc "; $result=mysql_query($sql); ?> <table width="400" border="0" cellspacing="1" cellpadding="0"> <tr> <td> <table width="400" border="1" cellspacing="0" cellpadding="3"> <?php while($rows=mysql_fetch_array($result)){ ?> <span class="elevenbold"><? echo $rows['Day']; ?> <? echo $rows['Month']; ?> <br><strong class="elevenboldblue"><? echo $rows['Song']; ?></strong><br><? echo $rows['Data']; ?></span><br><br> <?php } ?> </table> </td> </tr> </table> <?php mysql_close(); ?>
  7. ive made my own script to work with phpbb3 but i keep getting a error in this part can someone help me plz <?php if(in_array(1697, $group_id_ary) { echo "You can now add the show want to."; include ('inc/addshow.php'); } else { echo "You do not have the rights to use this page. Login to gain access"; } ?> this is the error im getting Parse error: syntax error, unexpected '{' in /home/wow/public_html/tvmugg/addshow.php on line 41
  8. no all the files for that are in the hubs dir i did try it and get this error Parse error: syntax error, unexpected T_STRING, expecting T_CASE or T_DEFAULT or '}' in /home/asgards1/www/hubs/index1.php on line 5
  9. i have found this script <?Php // Define our array of allowed $_GET values $pass = array('main','ts','guides','news','hublist'); // If the page is allowed, include it: if (in_array($_GET['page'], $pass)) { include ($_SERVER['DOCUMENT_ROOT'] . 'hubs/' . $_GET['page'] . '.php'); } // This will load the default page: elseif (!isset($_GET['page'])) { include ($_SERVER['DOCUMENT_ROOT'] . '/main.php'); } // If the page is not allowed, send them to an error page: else { // This send the 404 header header("HTTP/1.0 404 Not Found"); // This includes the error page include ($_SERVER['DOCUMENT_ROOT'] . '/error.php'); } ?> but when i put thin the link like www.mydomain.com/index.php?p=guides i just keep getting up the main page and the others wont load can some one help me plz
  10. if no one can help me with this can anyone tell me were i can get a script what will read the database so i can add recoreds update them or edit them throw a php page thanks in advance
  11. Error of syntax close of '' to line 1 is wat the error code says
  12. hi have this script add record work but i can get udate or delete to work i keep getting this error Erreur de syntaxe près de '' à la ligne 1 here is my script <?php session_start(); if (isset($_GET["order"])) $order = @$_GET["order"]; if (isset($_GET["type"])) $ordtype = @$_GET["type"]; if (isset($_POST["filter"])) $filter = @$_POST["filter"]; if (isset($_POST["filter_field"])) $filterfield = @$_POST["filter_field"]; $wholeonly = false; if (isset($_POST["wholeonly"])) $wholeonly = @$_POST["wholeonly"]; if (!isset($order) && isset($_SESSION["order"])) $order = $_SESSION["order"]; if (!isset($ordtype) && isset($_SESSION["type"])) $ordtype = $_SESSION["type"]; if (!isset($filter) && isset($_SESSION["filter"])) $filter = $_SESSION["filter"]; if (!isset($filterfield) && isset($_SESSION["filter_field"])) $filterfield = $_SESSION["filter_field"]; ?> <html> <head> <title>hub -- hub1</title> <meta name="generator" http-equiv="content-type" content="text/html"> <style type="text/css"> body { background-color: #A9A9A9; color: #004080; font-family: Arial; font-size: 12px; } .bd { background-color: #A9A9A9; color: #004080; font-family: Arial; font-size: 12px; } .tbl { background-color: #A9A9A9; } a:link { background-color: #FFFFFF01; color: #FF0000; font-family: Arial; font-size: 12px; } a:active { background-color: #FFFFFF01; color: #0000FF; font-family: Arial; font-size: 12px; } a:visited { color: #800080; font-family: Arial; font-size: 12px; } .hr { background-color: #336699; color: #FFFFFF; font-family: Arial; font-size: 12px; } a.hr:link { color: #FFFFFF; font-family: Arial; font-size: 12px; } a.hr:active { color: #FFFFFF; font-family: Arial; font-size: 12px; } a.hr:visited { color: #FFFFFF; font-family: Arial; font-size: 12px; } .dr { background-color: #FFFFFF; color: #000000; font-family: Arial; font-size: 12px; } .sr { background-color: #FFFFCF; color: #000000; font-family: Arial; font-size: 12px; } </style> </head> <body> <table class="bd" width="100%"><tr><td class="hr"><h2>PHP Generator</h2></td></tr></table> <table width="100%"> <tr> <td width="10%" valign="top"> <li><a href="hub10.php?a=reset">hub10</a> <li><a href="hub2.php?a=reset">hub2</a> <li><a href="hub3.php?a=reset">hub3</a> <li><a href="hub4.php?a=reset">hub4</a> <li><a href="hub5.php?a=reset">hub5</a> <li><a href="hub6.php?a=reset">hub6</a> <li><a href="hub7.php?a=reset">hub7</a> <li><a href="hub8.php?a=reset">hub8</a> <li><a href="hub9.php?a=reset">hub9</a> </td> <td width="5%"> </td> <td bgcolor="#e0e0e0"> </td> <td width="5%"> </td> <td width="80%" valign="top"> <?php $conn = connect(); $showrecs = 20; $pagerange = 10; $a = @$_GET["a"]; $recid = @$_GET["recid"]; $page = @$_GET["page"]; if (!isset($page)) $page = 1; $sql = @$_POST["sql"]; switch ($sql) { case "insert": sql_insert(); break; case "update": sql_update(); break; case "delete": sql_delete(); break; } switch ($a) { case "add": addrec(); break; case "view": viewrec($recid); break; case "edit": editrec($recid); break; case "del": deleterec($recid); break; default: select(); break; } if (isset($order)) $_SESSION["order"] = $order; if (isset($ordtype)) $_SESSION["type"] = $ordtype; if (isset($filter)) $_SESSION["filter"] = $filter; if (isset($filterfield)) $_SESSION["filter_field"] = $filterfield; if (isset($wholeonly)) $_SESSION["wholeonly"] = $wholeonly; mysql_close($conn); ?> </td></tr></table> </body> </html> <?php function select() { global $a; global $showrecs; global $page; global $filter; global $filterfield; global $wholeonly; global $order; global $ordtype; if ($a == "reset") { $filter = ""; $filterfield = ""; $wholeonly = ""; $order = ""; $ordtype = ""; } $checkstr = ""; if ($wholeonly) $checkstr = " checked"; if ($ordtype == "asc") { $ordtypestr = "desc"; } else { $ordtypestr = "asc"; } $res = sql_select(); $count = sql_getrecordcount(); if ($count % $showrecs != 0) { $pagecount = intval($count / $showrecs) + 1; } else { $pagecount = intval($count / $showrecs); } $startrec = $showrecs * ($page - 1); if ($startrec < $count) {mysql_data_seek($res, $startrec);} $reccount = min($showrecs * $page, $count); ?> <table class="bd" border="0" cellspacing="1" cellpadding="4"> <tr><td>Table: hub1</td></tr> <tr><td>Records shown <?php echo $startrec + 1 ?> - <?php echo $reccount ?> of <?php echo $count ?></td></tr> </table> <hr size="1" noshade> <form action="hub1.php" method="post"> <table class="bd" border="0" cellspacing="1" cellpadding="4"> <tr> <td><b>Custom Filter</b> </td> <td><input type="text" name="filter" value="<?php echo $filter ?>"></td> <td><select name="filter_field"> <option value="">All Fields</option> <option value="<?php echo "hub1" ?>"<?php if ($filterfield == "hub1") { echo "selected"; } ?>><?php echo htmlspecialchars("hub1") ?></option> <option value="<?php echo "hubname1" ?>"<?php if ($filterfield == "hubname1") { echo "selected"; } ?>><?php echo htmlspecialchars("hubname1") ?></option> <option value="<?php echo "address1" ?>"<?php if ($filterfield == "address1") { echo "selected"; } ?>><?php echo htmlspecialchars("address1") ?></option> <option value="<?php echo "port1" ?>"<?php if ($filterfield == "port1") { echo "selected"; } ?>><?php echo htmlspecialchars("port1") ?></option> <option value="<?php echo "owner1" ?>"<?php if ($filterfield == "owner1") { echo "selected"; } ?>><?php echo htmlspecialchars("owner1") ?></option> <option value="<?php echo "dchubaddress1" ?>"<?php if ($filterfield == "dchubaddress1") { echo "selected"; } ?>><?php echo htmlspecialchars("dchubaddress1") ?></option> </select></td> <td><input type="checkbox" name="wholeonly"<?php echo $checkstr ?>>Whole words only</td> </td></tr> <tr> <td> </td> <td><input type="submit" name="action" value="Apply Filter"></td> <td><a href="hub1.php?a=reset">Reset Filter</a></td> </tr> </table> </form> <hr size="1" noshade> <?php showpagenav($page, $pagecount); ?> <br> <table class="tbl" border="0" cellspacing="1" cellpadding="5"width="100%"> <tr> <td class="hr"> </td> <td class="hr"> </td> <td class="hr"> </td> <td class="hr"><a class="hr" href="hub1.php?order=<?php echo "hub1" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("hub1") ?></a></td> <td class="hr"><a class="hr" href="hub1.php?order=<?php echo "hubname1" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("hubname1") ?></a></td> <td class="hr"><a class="hr" href="hub1.php?order=<?php echo "address1" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("address1") ?></a></td> <td class="hr"><a class="hr" href="hub1.php?order=<?php echo "port1" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("port1") ?></a></td> <td class="hr"><a class="hr" href="hub1.php?order=<?php echo "owner1" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("owner1") ?></a></td> <td class="hr"><a class="hr" href="hub1.php?order=<?php echo "dchubaddress1" ?>&type=<?php echo $ordtypestr ?>"><?php echo htmlspecialchars("dchubaddress1") ?></a></td> </tr> <?php for ($i = $startrec; $i < $reccount; $i++) { $row = mysql_fetch_assoc($res); $style = "dr"; if ($i % 2 != 0) { $style = "sr"; } ?> <tr> <td class="<?php echo $style ?>"><a href="hub1.php?a=view&recid=<?php echo $i ?>">View</a></td> <td class="<?php echo $style ?>"><a href="hub1.php?a=edit&recid=<?php echo $i ?>">Edit</a></td> <td class="<?php echo $style ?>"><a href="hub1.php?a=del&recid=<?php echo $i ?>">Delete</a></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["hub1"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["hubname1"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["address1"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["port1"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["owner1"]) ?></td> <td class="<?php echo $style ?>"><?php echo htmlspecialchars($row["dchubaddress1"]) ?></td> </tr> <?php } mysql_free_result($res); ?> </table> <br> <?php } ?> <?php function showrow($row, $recid) { ?> <table class="tbl" border="0" cellspacing="1" cellpadding="5"width="50%"> <tr> <td class="hr"><?php echo htmlspecialchars("hub1")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["hub1"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("hubname1")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["hubname1"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("address1")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["address1"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("port1")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["port1"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("owner1")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["owner1"]) ?></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("dchubaddress1")." " ?></td> <td class="dr"><?php echo htmlspecialchars($row["dchubaddress1"]) ?></td> </tr> </table> <?php } ?> <?php function showroweditor($row, $iseditmode) { global $conn; ?> <table class="tbl" border="0" cellspacing="1" cellpadding="5"width="50%"> <tr> <td class="hr"><?php echo htmlspecialchars("hub1")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="hub1" maxlength="255"><?php echo str_replace('"', '"', trim($row["hub1"])) ?></textarea></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("hubname1")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="hubname1" maxlength="255"><?php echo str_replace('"', '"', trim($row["hubname1"])) ?></textarea></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("address1")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="address1" maxlength="255"><?php echo str_replace('"', '"', trim($row["address1"])) ?></textarea></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("port1")." " ?></td> <td class="dr"><input type="text" name="port1" value="<?php echo str_replace('"', '"', trim($row["port1"])) ?>"></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("owner1")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="owner1" maxlength="255"><?php echo str_replace('"', '"', trim($row["owner1"])) ?></textarea></td> </tr> <tr> <td class="hr"><?php echo htmlspecialchars("dchubaddress1")." " ?></td> <td class="dr"><textarea cols="35" rows="4" name="dchubaddress1" maxlength="255"><?php echo str_replace('"', '"', trim($row["dchubaddress1"])) ?></textarea></td> </tr> </table> <?php } ?> <?php function showpagenav($page, $pagecount) { ?> <table class="bd" border="0" cellspacing="1" cellpadding="4"> <tr> <td><a href="hub1.php?a=add">Add Record</a> </td> <?php if ($page > 1) { ?> <td><a href="hub1.php?page=<?php echo $page - 1 ?>"><< Prev</a> </td> <?php } ?> <?php global $pagerange; if ($pagecount > 1) { if ($pagecount % $pagerange != 0) { $rangecount = intval($pagecount / $pagerange) + 1; } else { $rangecount = intval($pagecount / $pagerange); } for ($i = 1; $i < $rangecount + 1; $i++) { $startpage = (($i - 1) * $pagerange) + 1; $count = min($i * $pagerange, $pagecount); if ((($page >= $startpage) && ($page <= ($i * $pagerange)))) { for ($j = $startpage; $j < $count + 1; $j++) { if ($j == $page) { ?> <td><b><?php echo $j ?></b></td> <?php } else { ?> <td><a href="hub1.php?page=<?php echo $j ?>"><?php echo $j ?></a></td> <?php } } } else { ?> <td><a href="hub1.php?page=<?php echo $startpage ?>"><?php echo $startpage ."..." .$count ?></a></td> <?php } } } ?> <?php if ($page < $pagecount) { ?> <td> <a href="hub1.php?page=<?php echo $page + 1 ?>">Next >></a> </td> <?php } ?> </tr> </table> <?php } ?> <?php function showrecnav($a, $recid, $count) { ?> <table class="bd" border="0" cellspacing="1" cellpadding="4"> <tr> <td><a href="hub1.php">Index Page</a></td> <?php if ($recid > 0) { ?> <td><a href="hub1.php?a=<?php echo $a ?>&recid=<?php echo $recid - 1 ?>">Prior Record</a></td> <?php } if ($recid < $count - 1) { ?> <td><a href="hub1.php?a=<?php echo $a ?>&recid=<?php echo $recid + 1 ?>">Next Record</a></td> <?php } ?> </tr> </table> <hr size="1" noshade> <?php } ?> <?php function addrec() { ?> <table class="bd" border="0" cellspacing="1" cellpadding="4"> <tr> <td><a href="hub1.php">Index Page</a></td> </tr> </table> <hr size="1" noshade> <form enctype="multipart/form-data" action="hub1.php" method="post"> <p><input type="hidden" name="sql" value="insert"></p> <?php $row = array( "hub1" => "", "hubname1" => "", "address1" => "", "port1" => "", "owner1" => "", "dchubaddress1" => ""); showroweditor($row, false); ?> <p><input type="submit" name="action" value="Post"></p> </form> <?php } ?> <?php function viewrec($recid) { $res = sql_select(); $count = sql_getrecordcount(); mysql_data_seek($res, $recid); $row = mysql_fetch_assoc($res); showrecnav("view", $recid, $count); ?> <br> <?php showrow($row, $recid) ?> <br> <hr size="1" noshade> <table class="bd" border="0" cellspacing="1" cellpadding="4"> <tr> <td><a href="hub1.php?a=add">Add Record</a></td> <td><a href="hub1.php?a=edit&recid=<?php echo $recid ?>">Edit Record</a></td> <td><a href="hub1.php?a=del&recid=<?php echo $recid ?>">Delete Record</a></td> </tr> </table> <?php mysql_free_result($res); } ?> <?php function editrec($recid) { $res = sql_select(); $count = sql_getrecordcount(); mysql_data_seek($res, $recid); $row = mysql_fetch_assoc($res); showrecnav("edit", $recid, $count); ?> <br> <form enctype="multipart/form-data" action="hub1.php" method="post"> <input type="hidden" name="sql" value="update"> <input type="hidden" name="xhub1" value="<?php echo $row["hub1"] ?>"> <?php showroweditor($row, true); ?> <p><input type="submit" name="action" value="Post"></p> </form> <?php mysql_free_result($res); } ?> <?php function deleterec($recid) { $res = sql_select(); $count = sql_getrecordcount(); mysql_data_seek($res, $recid); $row = mysql_fetch_assoc($res); showrecnav("del", $recid, $count); ?> <br> <form action="hub1.php" method="post"> <input type="hidden" name="sql" value="delete"> <input type="hidden" name="xhub1" value="<?php echo $row["hub1"] ?>"> <?php showrow($row, $recid) ?> <p><input type="submit" name="action" value="Confirm"></p> </form> <?php mysql_free_result($res); } ?> <?php function connect() { $conn = mysql_connect("localhost", "hub", "angel"); mysql_select_db("hub"); return $conn; } function sqlvalue($val, $quote) { if ($quote) $tmp = sqlstr($val); else $tmp = $val; if ($tmp == "") $tmp = "NULL"; elseif ($quote) $tmp = "'".$tmp."'"; return $tmp; } function sqlstr($val) { return str_replace("'", "''", $val); } function sql_select() { global $conn; global $order; global $ordtype; global $filter; global $filterfield; global $wholeonly; $filterstr = sqlstr($filter); if (!$wholeonly && isset($wholeonly) && $filterstr!='') $filterstr = "%" .$filterstr ."%"; $sql = "SELECT `hub1`, `hubname1`, `address1`, `port1`, `owner1`, `dchubaddress1` FROM `hub1`"; if (isset($filterstr) && $filterstr!='' && isset($filterfield) && $filterfield!='') { $sql .= " where " .sqlstr($filterfield) ." like '" .$filterstr ."'"; } elseif (isset($filterstr) && $filterstr!='') { $sql .= " where (`hub1` like '" .$filterstr ."') or (`hubname1` like '" .$filterstr ."') or (`address1` like '" .$filterstr ."') or (`port1` like '" .$filterstr ."') or (`owner1` like '" .$filterstr ."') or (`dchubaddress1` like '" .$filterstr ."')"; } if (isset($order) && $order!='') $sql .= " order by `" .sqlstr($order) ."`"; if (isset($ordtype) && $ordtype!='') $sql .= " " .sqlstr($ordtype); $res = mysql_query($sql, $conn) or die(mysql_error()); return $res; } function sql_getrecordcount() { global $conn; global $order; global $ordtype; global $filter; global $filterfield; global $wholeonly; $filterstr = sqlstr($filter); if (!$wholeonly && isset($wholeonly) && $filterstr!='') $filterstr = "%" .$filterstr ."%"; $sql = "SELECT COUNT(*) FROM `hub1`"; if (isset($filterstr) && $filterstr!='' && isset($filterfield) && $filterfield!='') { $sql .= " where " .sqlstr($filterfield) ." like '" .$filterstr ."'"; } elseif (isset($filterstr) && $filterstr!='') { $sql .= " where (`hub1` like '" .$filterstr ."') or (`hubname1` like '" .$filterstr ."') or (`address1` like '" .$filterstr ."') or (`port1` like '" .$filterstr ."') or (`owner1` like '" .$filterstr ."') or (`dchubaddress1` like '" .$filterstr ."')"; } $res = mysql_query($sql, $conn) or die(mysql_error()); $row = mysql_fetch_assoc($res); reset($row); return current($row); } function sql_insert() { global $conn; global $_POST; $sql = "insert into `hub1` (`hub1`, `hubname1`, `address1`, `port1`, `owner1`, `dchubaddress1`) values (" .sqlvalue(@$_POST["hub1"], true).", " .sqlvalue(@$_POST["hubname1"], true).", " .sqlvalue(@$_POST["address1"], true).", " .sqlvalue(@$_POST["port1"], false).", " .sqlvalue(@$_POST["owner1"], true).", " .sqlvalue(@$_POST["dchubaddress1"], true).")"; mysql_query($sql, $conn) or die(mysql_error()); } function sql_update() { global $conn; global $_POST; $sql = "update `hub1` set `hub1`=" .sqlvalue(@$_POST["hub1"], true).", `hubname1`=" .sqlvalue(@$_POST["hubname1"], true).", `address1`=" .sqlvalue(@$_POST["address1"], true).", `port1`=" .sqlvalue(@$_POST["port1"], false).", `owner1`=" .sqlvalue(@$_POST["owner1"], true).", `dchubaddress1`=" .sqlvalue(@$_POST["dchubaddress1"], true) ." where " .primarykeycondition(); mysql_query($sql, $conn) or die(mysql_error()); } function sql_delete() { global $conn; $sql = "delete from `hub1` where " .primarykeycondition(); mysql_query($sql, $conn) or die(mysql_error()); } function primarykeycondition() { global $_POST; $pk = ""; return $pk; } ?>
  13. this is the config script <? $username="xxxxxxxxxx"; $password="1234"; $database="xxxxxxxxxxxxxx"; if(!mysql_select_db($database, mysql_connect($host, $username, $password))) { die('Couldn\'t connect to the database. The following error occurred: '.mysql_error().'');exit; } $a = mysql_query("SELECT * FROM `hubs` WHERE `id` != '' ORDER BY `id` DESC"); while($b = mysql_fetch_assoc($a)) { echo '<div>ID#: '.$b['hub'].'</div>'; echo '<div>Name: '.$b['hubname'].'</div>'; echo '<div>Address: '.$b['address'].'</div>'; echo '<div>Port: '.$b['port'].'</div>'; echo '<div>Owner: '.$b['owner'].'</div>'; } ?> <?php $b['hub'] = @fsockopen("$b['address']","$b['port']", $errno, $errstr, 2); if($hub1) { $hub1=true; } else { $hub1=false; } ?> <?php $b['hub'] = @fsockopen("$b['address']", "$b['port']", $errno, $errstr, 2); if($hub2) { $hub2=true; } else { $hub2=false; } ?> and this is the page im wanting it to go to <style type="text/css"> <!-- .style1 {color: #D9FFB3} .style2 {color: #FFC6C6} body { background-color: #999999; } --> </style> <div align="center"> <table width="486" border="1"> <tr> <td width="57"><b>Name:</b></td> <td width="140"><div align="center"><?php echo $hubname ?></div></td> <td width="57"><b>DNS:</b></td> <td width="241"><div align="center"><a href='dchub://the-tardis.no-ip.com:2411'> the-tardis.no-ip.com:2411</a></div></td> </tr> <tr> <td><b>Owner:</b></td> <td><div align="center"><?php echo $owner ?></div></td> <td><b>Stats:</b></td> <td><div align="center"> <?php if($hub) { ?> <span class="style1">Online</span> <?php } else { ?> <span class="style2">Offline</span><?php } ?> </td> </tr> </table> <br /> <table width="486" border="1"> <tr> <td width="57"><b>Name:</b></td> <td width="140"><div align="center"><?php echo $hubname ?></div></td> <td width="57"><b>DNS:</b></td> <td width="241"><div align="center"><a href='dchub://ukmusic.no-ip.com:420'>ukmusic.no-ip.com:420</a><a href='dchub://the-tardis.no-ip.com:2411"'></a></div></td> </tr> <tr> <td><b>Owner:</b></td> <td><div align="center"><?php echo $owner ?></div></td> <td><b>Stats:</b></td> <td><div align="center"> <?php if($hub) { ?> <span class="style1">Online</span> <?php } else { ?> <span class="style2">Offline</span><?php } ?> </div></td> </tr> </table> <br /> </div> <p> </p> <div align="center"><?php echo $myString; ?></div>
  14. this is what i have so far i need it to go from the first one onto the next one getting the info from each line if thats anymore help <? $username="xxxxxxx"; $password="xxxxxxxxx"; $database="xxxxxxxxxxxxxxxxxxxxxxx"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM hubs"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); $i=0; while ($i < $num) { $hub=mysql_result($result,$i,"hub"); $hubname=mysql_result($result,$i,"hubname"); $address=mysql_result($result,$i,"address"); $port=mysql_result($result,$i,"port"); $owner=mysql_result($result,$i,"owner"); $i++; } ?>
  15. hi i have made a script what is all reading out of a sql databace right now after hours lol well this is what i need help with i have EG test address name 1 <address here> <name of test> 2 <address here> <name of test> but my PHP page only will ready line 1 and then wont go down and show line 2 i have about 10 lines i need to do can anyone help me plz
×
×
  • 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.