Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by techker

  1. i juste noticed that it works without the{} to thx for the quick reply
  2. hey guys i need info on how to incorparate a variable in this. $fileToRemove = " picture.jpg"; if (file_exists($fileToRemove)) { // yes the file does exist unlink($fileToRemove); } else { // the file is not found, do something about it??? } ok so my script is an uploader that upload images and puts the info in a database.the file is moved to a folder. now i can delete the info but not the pic so im calling the unlink function in my delete file i call to the url with a get now i wan't to do the same in my delete picture. in my delete .php $delRT = "DELETE FROM employees WHERE numero = ".$_GET['numero'].""; now i wan't to put in the unlink .$_GET['photo']." cause it contains the pic name but when i try to put it in between the ' ' it gives me an error..
  3. hy there guys im making a ringtone site for myself cause i have tons to share.now im finally catching mysql!lol it's like math.. but im having a problem with something.im getting a 406 page and i don't know how to bypass it. si this is my script(test script) <?php include("connect.php"); $dbhost="localhost"; $dbusername="techker_techker"; $dbpassword="techker"; $dbname="techker_ringtone"; // Connect to Mysql $connect = mysql_connect($dbhost, $dbusername, $dbpassword); //Select the correct database. $db = mysql_select_db($dbname,$connect) or die ("Could not select database"); $file_location = "/home/techker/public_html/Ring/ringtones/"; $name=$_POST['name']; $Gender=$_POST['gender']; $type=$_POST['type']; $file=($_FILES['file']['name']); $data = mysql_query(" SELECT * FROM `ringtones` LIMIT 0 , 30 ") or die(mysql_error()); ?> <table> <tr> <th>File</th> <th>Name</th> <th>Type</th> <th>Gender</th> </tr> <?php while (FALSE !== ($info = mysql_fetch_array($data))) { ?> <tr> <td><? Echo "<a href=\"/Ring/ringtones/".$info['file'] ."\">".$info['file']."</a><br>";?></td> <td><?php echo $info['name'] ?></td> <td><?php echo $info['type'] ?></td> <td><?php echo $info['Gender'] ?></td> <td><a href=/Ring/ringtones/><?php echo $info['file'] ?></a> </td> </tr> <?php } ?> </table> now this shows the song and it links to it.suppose to..lol <td><a href=/Ring/ringtones/><?php echo $info['file'] ?></a> </td> cause basically this script move the file uploaded to a folder and record it's info in a database. see it for yourself the first link on the page is with this Echo "<a href=\"/Ring/ringtones/".$info['file'] ."\">".$info['file']."</a><br>"; works great but 406 the second is with the above http://tech-design.info/Ring/html3.php
  4. 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?
  5. i fixed it by putting the right table.. but it brings out nothing only name ,phone,email..
  6. 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>
  7. 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.
  8. no i just have to make the echo look nicer..lol
  9. i got it going thx! <? $USERNAME = $_COOKIE['LMUSERNAME']; ?>
  10. 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
  11. 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 ?>
  12. i guess it could be pretty simple.no need for that.i was just referring to it.
  13. 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
  14. update with what and how?any example of a code?
  15. 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.
  16. 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!
  17. 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?
  18. 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
  19. no it isnt in this case tryed it..
  20. 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?
  21. well i do hav a login systeme but it is on the index page not the splash. thx for the link
  22. 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?
  23. 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
  • 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.