Jump to content

garevn

Members
  • Posts

    6
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

garevn's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. really tnx man I did an if else statement
  2. I am using this code and the result is "© Copyright 2013 - 2013". I want if possible if the current year is the same with the copyright year to display only one. for example the display will be "© Copyright 2013". <?php $time = time () ; $year= date("Y",$time); echo "© Copyright 2013 - " . $year; ?>
  3. But how i can i update the table when the user login.. i dont get it And the same question when he logout..
  4. Lets say i have 10 users in my database. I want to display 2 dynamic tables, one with the names from online users and one with the names from offline one.. Any suggestion i am a bit confused
  5. Hello erveryone. I am new in programming and i have the following problem i cant figure out! i want to make a search into my database. i have prepared my html-js-php files but it seems i have a php problem. When i search and i type whatever letter then i get those results only.. name: brand: price //my php file <?php require_once('../Connections/Mysitedb.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $colname_Recordset1 = "-1"; if (isset($_GET['productname'])) { $colname_Recordset1 = $_GET['productname']; } mysql_select_db($database_Mysitedb, $Mysitedb); $query_Recordset1 = sprintf("SELECT manufacturer, productname, price FROM products WHERE productname = %s", GetSQLValueString($colname_Recordset1, "text")); $Recordset1 = mysql_query($query_Recordset1, $Mysitedb) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> <!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> <?php do { ?> <form id="form1" name="form1" method="post" action=""> <table width="353"> <tr> <td width="59">name:</td> <td width="282"><?php echo $row_Recordset1['productname']; ?></td> </tr> <tr> <td>brand:</td> <td><?php echo $row_Recordset1['manufacturer']; ?></td> </tr> <tr> <td>price</td> <td><?php echo $row_Recordset1['price']; ?></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </table> </form> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?> </body> </html> <?php mysql_free_result($Recordset1); ?>
  6. Hello i am trying to have an ajax search with my databse records but it doesnt work pls some help:( i have 3 files js3.js data.php body.html //js3.js var xmlHttp; function finding(str){ try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = new XMLHttpRequest(); } } if(!xmlhttp) { alert("Browser does not support HTTP Request"); return; } var url="data.php"; url=url+"?productname="+str; url=url+"&sid="+Math.random(); xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET","data.php?q="+str,true); xmlHttp.send(null); } function stateChanged() { if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("result").innerHTML=xmlHttp.responseText } } function stateChanged() { if(xmlHttp.readyState==4|| xmlHttp.readyState=="complete") { document.getElementById("result").innerHTML=xmlHttp.responseText } } function GetXmlHttpObject() { var xmlHttp=null; } //body.html <script src="js3.js"></script> </head> <body> <form> search: <input type="text" size="30" onkeyup="finding(this.value)"/> </form> <p><div id="Result"></div> </p> </body> </html>
×
×
  • 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.