Jump to content

techker

Members
  • Posts

    812
  • Joined

  • Last visited

Everything posted by techker

  1. no lol it's all good now.i was using the wrong db... the only thing i need to now now is to css the echo..it is very ugly when you use tables.. any tricks on that?
  2. i fixed it by putting the right table.. but it brings out nothing only name ,phone,email..
  3. it gives me this Unknown column 'username' in 'where clause' <? $USERNAME = $_COOKIE['LMUSERNAME']; ?> <?php // Make a MySQL Connection mysql_connect("localhost", "techker_admin", "techker") or die(mysql_error()); mysql_select_db("hugues_login") or die(mysql_error()); // Retrieve all the data from the "example" table $result = mysql_query(" SELECT * FROM authuser WHERE username ='$USERNAME'") or die(mysql_error()); while ($ligne = mysql_fetch_array($result)) { // mysql_fetch_array() : Retourne une ligne de résultat MySQL sous la forme d'un tableau associatif, //echo("<ul>"); //echo("<li>Phone : <b>" . $ligne['phone'] . "</b></li>"); //echo("<li>Email : <b>" . $ligne['email'] . "</b></li>"); //echo("<li>status : <b>" . $ligne['status'] . "</b></li>"); //echo("</ul>"); } // Ferme la connexion au serveur MySQL mysql_close($connection); ?> <html> <head> <title>LFNC </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- body { background-image: url(images/rez_1.jpg); } .style1 {color: #FFFFFF} a:link { color: #FFFFFF; text-decoration: none; } a:visited { text-decoration: none; color: #FFFFFF; } a:hover { text-decoration: none; } a:active { text-decoration: none; } --> </style> <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script> </head> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <!-- ImageReady Slices (cpanel_2.psd) --> <table width="766" height="601" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01"> <tr> <td height="144" colspan="2"> <img src="images/cpanel_2_01.jpg" width="189" height="144" alt=""></td> <td colspan="3"> <img src="images/cpanel_2_02.jpg" width="478" height="144" alt=""></td> <td colspan="2"> <img src="images/cpanel_2_03.jpg" width="99" height="144" alt=""></td> </tr> <tr> <td height="30" colspan="7" background="images/cpanel_2_04.jpg"><table width="766" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="128" height="26" class="style1"><div align="center"><a href="logout.html">Déconnection</a></div></td> <td width="273">Utilisateur en ligne <? echo $USERNAME ?> </td> <td width="208"> </td> <td width="157"><div align="right" class="style1"> <div align="center" class="style1">Utilisateur v1.0</div> </div></td> </tr> </table></td> </tr> <tr> <td rowspan="2"> <img src="images/cpanel_2_05.jpg" width="17" height="423" alt=""></td> <td height="409" colspan="2" valign="top" background="images/cpanel_2_06.jpg"><table width="211" height="162" border="0" cellpadding="0" cellspacing="0"> <tr> <td><? echo("<ul>"); echo("<li>Phone : <b>" . $ligne['phone'] . "</b></li>"); echo("<li>Email : <b>" . $ligne['email'] . "</b></li>"); echo("<li>status : <b>" . $ligne['status'] . "</b></li>"); echo("</ul>");?></td> </tr> </table></td> <td rowspan="2"> <img src="images/cpanel_2_07.jpg" width="12" height="423" alt=""></td> <td colspan="2" rowspan="2"><script type="text/javascript"> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','509','height','423','src','flash/web_panel_fr','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','flash/web_panel_fr' ); //end AC code </script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="509" height="423"> <param name="movie" value="flash/web_panel_fr.swf"> <param name="quality" value="high"> <embed src="flash/web_panel_fr.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="509" height="423"></embed> </object></noscript></td> <td rowspan="2"> <img src="images/cpanel_2_09.jpg" width="17" height="423" alt=""></td> </tr> <tr> <td height="14" colspan="2"> <img src="images/cpanel_2_10.jpg" width="211" height="14" alt=""></td> </tr> <tr> <td height="2"> <img src="images/spacer.gif" width="17" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="172" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="39" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="12" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="427" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="82" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="17" height="1" alt=""></td> </tr> </table> <p> <!-- End ImageReady Slices --> </p> <table width="100" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><a href="http://www.tech-design.info" target="_blank"><img src="images/tech.jpg" width="125" height="45" border="0"></a></td> </tr> </table> <p> </p> </body> </html>
  4. hi there i will explain my situation then ask the question i have a login script that i need to mod.when you logue in i wan't the username to apear on top.thats done with this <? $USERNAME = $_COOKIE['LMUSERNAME']; ?> <? echo $USERNAME ?> now i want to display the clients info in a box on the web page. so im ok for the connection but my question is how to query only that user not all.. im guessing in my sql query $resultat = mysql_query("SELECT * FROM authuser "); is there a way to in there only from $username so i can fetch all the info of that user only.
  5. no i just have to make the echo look nicer..lol
  6. i got it going thx! <? $USERNAME = $_COOKIE['LMUSERNAME']; ?>
  7. it gives me an undifined variable <? echo '<pre>', print_r($_SESSION, 1), '</pre>'; ?> Notice: Undefined variable: _SESSION in h:\lfnc\easyphp1-8\www\utilisateur.php on line 31
  8. hey guys im having a problem trying to echo the user that is logged in in the login script my client has. any body know login manager v3? if not it does not mater. so i have tried with echo $username but after it tells me undefined variable.. i need to know were to start with this when you already have a script made up.. cause what is confusing me is how will it know witch user is logged in? in this script.there is the form that referes to : <? setcookie ("LMUSERNAME", $_POST['username']); setcookie ("LMPASSWORD", $_POST['password']); include_once ("auth_member.php"); include_once ("admin/authconfig.php"); $username = $_POST['username']; $password = $_POST['password']; $Auth = new auth(); $detail = $Auth->authenticate($username, $password,$dbhost,$dbusername,$dbpass,$dbname); if (($detail==0)||($detail['uname'] == $adminusername)) { ?><HEAD> <SCRIPT language="JavaScript1.1"> <!-- location.replace("<? echo "$failure"; ?>"); //--> </SCRIPT> </HEAD> <? } else { $connection = mysql_connect($dbhost, $dbusername, $dbpass); $SelectedDB = mysql_select_db($dbname); $result = mysql_query("select distinct welcome from authuser where uname='$username'"); while($row = mysql_fetch_array($result, MYSQL_NUM)) { $v_welcome=$row[0]; } if ($v_welcome=='1'){ mysql_query("update authuser set welcome='0' where uname='$username'"); mysql_close($connection); echo "<meta http-equiv=\"refresh\" content=\"0; URL=$welcome\">"; exit; } else { mysql_close($connection); echo "<meta http-equiv=\"refresh\" content=\"0; URL=$success\">"; exit; } } ?> witch calls [code=php:0] <? class auth{ // AUTHENTICATE function authenticate($username, $password,$dbhost,$dbusername,$dbpass,$dbname) { $enpass=base64_encode("$password"); $query = "SELECT * FROM authuser WHERE uname='$username' AND passwd='$enpass' AND status <> '0'"; $UpdateRecords = "UPDATE authuser SET lastlogin = NOW(), logincount = logincount + 1 WHERE uname='$username' and status='1'"; $connection = mysql_connect($dbhost, $dbusername, $dbpass); $SelectedDB = mysql_select_db($dbname); $result = mysql_query($query); $numrows = mysql_num_rows($result); $row = mysql_fetch_array($result); // CHECK IF THERE ARE RESULTS if ($numrows == 0) { return 0; } else { $Update = mysql_query($UpdateRecords); return $row; } } // End: function authenticate function page_check($username, $password,$dbhost,$dbusername,$dbpass,$dbname) { $enpass=base64_encode("$password"); $query = "SELECT * FROM authuser WHERE uname='$username' AND passwd='$enpass' AND status <> '0'"; $connection = mysql_connect($dbhost, $dbusername, $dbpass); $SelectedDB = mysql_select_db($dbname); $result = mysql_query($query); $numrows = mysql_num_rows($result); $row = mysql_fetch_array($result); if ($numrows == 0) { return false; } else { return $row; } } // End: function page_check } // End: class auth ?>
  9. i guess it could be pretty simple.no need for that.i was just referring to it.
  10. hi guys im woundering if any body could help me find a tutorial for this: i have a friend that i made a web site for and he is a distributor. now he has some products that sell like hot cakes. i want to make him a page that contains his monthly hot cakes but i want him to update it. i have an idea but still a newbe at this.. i can make the database and some of the code.but i have now idea how to make this. thx for the help.hope im clear in my explanation..lol
  11. update with what and how?any example of a code?
  12. so basicly with a regular account you can control it but the c panel is only one? i only need something basic and cheap for now im just starting and low cash flow. thx for the link.
  13. hey guys i want to get a reseller account and im looking at so many deals !man every body has different plans and some rape big time!lol so i found one with very good rating and pretty cheap to 10 gigs with 150gigs bandwidth.. no my question is bandwidth.when is the bandwidth used the most is it good 150gigs? have a look at what they are offering.is there more for cheap..lol im not confident anymore there is to mutch out there.... and my regular hoster offers it to but a good price diffrence.. http://www.webhostingstuff.com/review/ScalaHosting.html and my hoster www.yrhost.com there for the help!
  14. hey guy,quick question. is there a way to put an invisible counter on my main page the retrieve the info in my admin panel?
  15. hey guys i have a book (php hack) it shows how to gen a php page with xml spread sheet. http://techker.prophp.org/test/ now is there a way to save that spread sheet in a database and fetch it aftherwords? im new to database so please be gental..lol here is the code index page with upload: PHP Code: <html> <body> <form enctype="multipart/form-data" action="import.php" method="post"> Excel XML file: <input type="hidden" name="MAX_FILE_SIZE" value="2000000" /> <input type="file" name="file" /><br/> <input type="submit" value="Upload" /> </form> </body> </html> import page (generater) PHP Code: <html> <body> <?php $data = array(); if ( $_FILES['file']['tmp_name'] ) { $dom = DOMDocument::load( $_FILES['file']['tmp_name'] ); $rows = $dom->getElementsByTagName( 'Row' ); foreach ($rows as $row) { $cells = $row->getElementsByTagName( 'Cell' ); $datarow = array(); foreach ($cells as $cell) { $datarow []= $cell->nodeValue; } $data []= $datarow; } } ?> <table> <?php foreach( $data as $row ) { ?> <tr> <?php foreach( $row as $item ) { ?> <td><?php echo( $item ); ?></td> <?php } ?> </tr> <?php } ?> </table> </body> </html> there is this to in the book but i have no clue how to use it.do i link it to the upload form? generates sql from xml <?php $tables = array(); $indata = 0; function encode( $text ) { $text = preg_replace( "/'/", "''", $text ); return "'".$text."'"; } function start_element( $parser, $name, $attribs ) { global $tables, $indata; if ( $name == "WORKSHEET" ) { $tables []= array( 'name' => $attribs['SS:NAME'], 'data' => array() ); } if ( $name == "ROW" ) { $tables[count($tables)-1]['data'] []= array(); } if ( $name == "DATA" ) { $indata = 1; } } function text( $parser, $text ) { global $tables, $indata; if ( $indata ) { $data =& $tables[count($tables)-1]['data']; $data[count($data)-1] []= $text; } } function end_element( $parser, $name ) { global $indata; if ( $name == "DATA" ) $indata = 0; } $parser = xml_parser_create( ); xml_set_element_handler( $parser, "start_element", "end_element" ); xml_set_character_data_handler( $parser, "text" ); while( !feof( STDIN ) ) { $text = fgets( STDIN ); xml_parse( $parser, $text ); } xml_parser_free( $parser ); foreach( $tables as $table ) { $name = $table['name']; $data =& $table['data']; $cols = implode( ", ", $data[0] ); for( $in = 1; $in < count( $data ); $in++ ) { $sqldata = implode( ", ", array_map( "encode", $data[$in] ) ); ?> INSERT INTO <?php echo( $name )?> ( <?php echo( $cols ) ?> ) VALUES ( <?php echo( $sqldata ); ?> ); <?php } } ?> what is command-line version of PHP ? they say to use it with this? this is what it says Use the command-line version of PHP to run the SQL generator script on the Excel XML data: % php gen.php < data.xml INSERT INTO Publisher ( ID, Name ) VALUES ( '0', 'O''Reilly' ); INSERT INTO Publisher ( ID, Name ) VALUES ( '0', 'Manning' ); INSERT INTO Publisher ( ID, Name ) VALUES ( '0', 'Wiley' ); INSERT INTO Publisher ( ID, Name ) VALUES ( '0', 'Addison-Wesley' ); INSERT INTO Publisher ( ID, Name ) VALUES ( '0', 'Pragmatic Press' ); INSERT INTO Publisher ( ID, Name ) VALUES ( '0', 'APress' ); You can also pipe this right into a file, for example: % php gen.php < data.xml > publishers.sql
  16. no it isnt in this case tryed it..
  17. any body know how to use this? so basicly it is good for importing excell sheets on a linux server and it converts it to php?? i have tryed it but i don't know how to retreive it from the database?
  18. well i do hav a login systeme but it is on the index page not the splash. thx for the link
  19. hey guys i have a splash page thats hase a choice of french or english site. but i want to add a remember choise button on the page so the clients don't have to always go tru the splash page every time? is it possible to do it in a simple way without going tru the login script?
  20. hey guys i need to scripts for a web site but im not shure what they are called or what to look for?: the first i need to be able to view excel sheets cause the distributor works with excel for price lists.i want him to be able to updates his lists him self.. is there such an apps that converst excell to html or pdf? and the other,he hase many price lists availible on the site i want to be able to list them and have check boxes in front to chose the ons they want to view and print.. i have that at work on are main intern web site ,when i want to view planogrames i chose which one i want and it merges to pdf. thx
  21. lol i have been looking at that work for about 10 minutes now and i new something was wrong with it..and even and i got the confirmation in anather forum to. now if i rename it to x_check will it have any concequence's to my script? and another guy told me to need to normalize that table what does he mean? what about this? fax VARCHAR(50), moneyorder VARCHAR(50), cc VARCHAR(' at line 61 mysql error number: 1064
  22. so i looked at the page and i can't find any words on my sql? its says on line fax VARCHAR(50), moneyorder VARCHAR(50), cc VARCHAR(50), so basicly i wold have to `fax` and `cc`? maybe http://www.mysql.com/news-and-events/newsletter/2002-10/a0000000075.html
  23. so if i change these words will it mess up my script?
  24. hey guys i got this when installing a script..i can't seem to find the probleme? <!-- Database error in SunShop Installer: Invalid SQL: CREATE TABLE options ( title VARCHAR(100), hometitle VARCHAR(100), shopurl VARCHAR(100), homeurl VARCHAR(100), securepath VARCHAR(100), companyname VARCHAR(100), address TEXT, city VARCHAR(30), state VARCHAR(20), zip VARCHAR(20), country VARCHAR(30), phone VARCHAR(20), faxnumber VARCHAR(20), contactemail VARCHAR(100), taxrate VARCHAR(10), shipups VARCHAR(5), grnd VARCHAR(5), nextdayair VARCHAR(5), seconddayair VARCHAR(5), threeday VARCHAR(5), canada VARCHAR(5), worldwidex VARCHAR(5), worldwidexplus VARCHAR(5), fixedshipping VARCHAR(5), method VARCHAR(15), rate VARCHAR(20), productpath VARCHAR(50), catimage VARCHAR(50), catopen VARCHAR(50), viewcartimage VARCHAR(50), viewaccountimage VARCHAR(50), checkoutimage VARCHAR(50), helpimage VARCHAR(50), cartimage VARCHAR(50), tablehead VARCHAR(50), tableheadtext VARCHAR(50), tableborder VARCHAR(50), tablebg VARCHAR(50), shipchart VARCHAR(50), ship1p1 VARCHAR(50), ship1us VARCHAR(50), ship1ca VARCHAR(50), ship2 VARCHAR(50), ship2p1 VARCHAR(50), ship2p2 VARCHAR(50), ship2us VARCHAR(50), ship2ca VARCHAR(50), ship3 VARCHAR(50), ship3p1 VARCHAR(50), ship3p2 VARCHAR(50), ship3us VARCHAR(50), ship3ca VARCHAR(50), ship4p1 VARCHAR(50), ship4us VARCHAR(50), ship4ca VARCHAR(50), visa VARCHAR(50), mastercard VARCHAR(50), discover VARCHAR(50), amex VARCHAR(50), check VARCHAR(50), fax VARCHAR(50), moneyorder VARCHAR(50), cc VARCHAR(50), payable VARCHAR(100), paypal VARCHAR(50), paypalemail VARCHAR(100), shopimage VARCHAR(100), centerborder VARCHAR(50), centerheader VARCHAR(50), centercolor VARCHAR(50), centerfont VARCHAR(50), centerbg VARCHAR(50), useheader VARCHAR(50), usefooter VARCHAR(50), myheader VARCHAR(50), myfooter VARCHAR(50), thumbheight VARCHAR(50), thumbwidth VARCHAR(50), picheight VARCHAR(50), picwidth VARCHAR(50), showstock VARCHAR(50), showitem VARCHAR(50), showintro VARCHAR(50), orderby VARCHAR(50), outofstock VARCHAR(50), cs VARCHAR(5), po VARCHAR(5), license VARCHAR(50), handling VARCHAR(20), imagel VARCHAR(1), showbestsellers varchar(5), showspecials varchar(5), language varchar(20), showcattotals varchar(5), shipcalc varchar(5), shipusps varchar(5), itemsperpage int(5), usesecurefooter varchar(5), mysecurefooter varchar(50), usesecureheader varchar(5), mysecureheader varchar(50), mustsignup varchar(5), uspsserver varchar(200), uspsuser varchar(100), uspspass varchar(100), catsdisplay VARCHAR(10), allwidth VARCHAR(10), centerwidth VARCHAR(10), tablewidth VARCHAR(10) ) mysql error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARCHAR(50), fax VARCHAR(50), moneyorder VARCHAR(50), cc VARCHAR(' at line 61 mysql error number: 1064
×
×
  • 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.