Jump to content

techker

Members
  • Posts

    812
  • Joined

  • Last visited

Everything posted by techker

  1. i only wish it would work now..lol i think it is at the connection. <?php mysql_connect("localhost", "root", "") or die(mysql_error()) ; mysql_select_db("eppa") or die(mysql_error()) ; $SQL=" SELECT * FROM `supps`WHERE bin_data = ".$_GET['bin_data']." LIMIT 0 , 30 "; $fileSQL=mysql_query($SQL); ?>
  2. wow.thx alot guys. wildteen88 thx for the examples.
  3. hey guys i need to echo a link with and echo in it.. like this content=4;url=/marlon/photo/thumbs/delete_pic_tn.php?bin_data=echo{$info['bin_data']}>"; [php i tryed it and it does not work? the page show this when it links "; } ?> se the reason why is this is a picture delter and it redirects to a thumbnail deleter but i need to echo the name so it can delete it. [code] <? include'connection.php'?> <? $file = $_GET['bin_data']; if (!unlink($file)) { echo ("Error deleting $file"); } else { echo ("Deleted $file"); echo "You'll be redirected to Home Page after (4) Seconds"; echo "<meta http-equiv=Refresh content=4;url=/marlon/photo/thumbs/delete_pic_tn.php?bin_data=echo{$info['bin_data']}>"; } ?>
  4. hm good point i was pasting the td to link the image to an info center..but you know what..screw it i will put a more button..lol i get what your saying for the mysql.thanks for the heads up i very new at this.. edit: by the way is there a way if i only use one td to make it on a horizontal line?cause now it echos in a vertical line?
  5. <?php // Connects to your Database mysql_connect("localhost", "r", "t") or die(mysql_error()); mysql_select_db("gym") or die(mysql_error()); $QQQ1 = mysql_query("SELECT * FROM supps WHERE bin_data ORDER BY RAND() LIMIT 4 "); if(!$QQQ1) die(mysql_error()); ?> <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> <table width="525" height="359" border="0" cellpadding="0" cellspacing="0"> <tr><?php while ($info=mysql_fetch_array($QQQ1)) {?> <td valign="top"><table width="525" height="160" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="160"><div align="center"><?php echo '<a href="/admin/photo/'. $info['bin_data'] .'"target="_blank"><img src="/admin/photo/thumbs/'. $info['bin_data'] .'" border="0" alt="" /></a><br />'."\n";?></div></td> <td><div align="center"><?php echo '<a href="/admin/photo/'. $info['bin_data'] .'"target="_blank"><img src="/admin/photo/thumbs/'. $info['bin_data'] .'" border="0" alt="" /></a><br />'."\n";?></div></td> <td><div align="center"><?php echo '<a href="/admin/photo/'. $info['bin_data'] .'"target="_blank"><img src="/admin/photo/thumbs/'. $info['bin_data'] .'" border="0" alt="" /></a><br />'."\n";?></div></td> <td><div align="center"><?php echo '<a href="/admin/photo/'. $info['bin_data'] .'"target="_blank"><img src="/admin/photo/thumbs/'. $info['bin_data'] .'" border="0" alt="" /></a><br />'."\n";?></div></td> </tr> </table></td> </tr> <tr> <td valign="top"> </td> </tr> <? }?> </table> </body> </html>
  6. ok.i have a page for my friend that contains an iframe that i want to extract for the database some images and text uder it.just to show some products. so i want on the top line 4 boxes with diffrent images in each.
  7. i googled aschk advice and came up with nothing?what is that? and for the select it is good but i get the same image in the 4 boxes?
  8. ya could be so..but i wan't to do that cause he has lots of products and i wan't to show it.
  9. i tryed using the example in the sticky $QQQ1 = mysql_query("SELECT * FROM supps AS t1 INNER JOIN ( SELECT ROUND(RAND() * (SELECT MAX(id) FROM supps)) AS id ) AS t2 ON t1.id >= t2.id ORDER BY t1.id ASC LIMIT 1; "); works but all the same image?i need for diffrent
  10. hey guys i have a 2 quick question for you pros. i have a site that i made a database that contains products.now i have every thing set up to view the products like a catalogue. now on the site it self i made a product page in there i want to post the image and link it to the information page.that it's ok. now the part im scratching my head is i wan't to post like 4 images but i need them different like a gallery in a square,how can i fetch only like 5 images in random order. 2 question. i wan't to make a cool background to put the product image and description but how can i make that same bgw repeat with another on the same page?cause usually u just put the fetch code once and it shows all the product in your database....
  11. well it works perfectly and like i said it does not put images in the database it move it to a folder if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) but i relly would like to store in a databse cause it would be lot more simpler..lol but i have tryed almost every tutorial out there with no success..
  12. i don't have an id but i have an inventory number. so in the database i don't know if it store the path? here is the add script. <?php $target = "images/big/"; $target2= "images/thumbs/"; $target3= "images/pics/"; $target = $target . basename( $_FILES['photo']['name']); $target2 = $target2 . basename( $_FILES['thumb']['name']); $target3 = $target3 . basename( $_FILES['pics']['name']); $3 =$_POST['3mois']; $6 =$_POST['6mois']; $12 =$_POST['12mois']; //$pic=($_FILES['photo']['name']); //$thumb=($_FILES['thumb']['name']); $15 =$_POST['15mois']; //$desc=$_POST['description']; //$pics=($_FILES['pics']['name']); // Connects to your Database mysql_connect("localhost", "techker_techker", "techker") or die(mysql_error()) ; mysql_select_db("techker_techker") or die(mysql_error()) ; //Writes the information to the database mysql_query("INSERT INTO `hours` VALUES ('$3', '$6', '$12', '$15')") ; //if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) //{ //if(move_uploaded_file($_FILES['thumb']['tmp_name'], $target2)) //{ //if(move_uploaded_file($_FILES['pics']['tmp_name'], $target3)) //{ //echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory"; echo "You'll be redirected to Home Page after (4) Seconds"; echo "<meta http-equiv=Refresh content=4;url=index.php>"; } else { echo "Sorry, there was a problem uploading your file."; } //} //} ?> it's a good idea do to delete all at the same time.and by getting the path
  13. ok i have a question concerning the get variable. i have this script that is used to post pics with descriptions and prices. now the uploading side uses es if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) so it stores the image in a folder and links it to a description store in my database. now i can delete the info no prob in the database the only thing is the pic that was uploaded isn't deleted at the same time. so i did my research and found the unlink function. $file = "pic name"; if (!unlink($file)) { echo ("Error deleting $file"); } else { echo ("Deleted $file"); } now i know i can do it.but im not shure how. so i did a link on that description page to delete the db and another to delete the pic <a href="deleter_pic.php?photo=<?php echo $info['photo'] ?>">Delete</a></td> so basicly this <?php echo $info['photo'] ?> shows the pic name in the url bar. from the help of the data base. now i know i can go get it with $_GET['photo'] witch will read the info on the url (photo is the name of the pic from db) 1rst question why do i get a 500 page? 2nd question is there a way to do this without a db? like when you click on the pic it does the same as my delete link without the help of the database to show the pic name? and on the delete page in the filename to delete how would it read the url? or is there an easer way? is it clear ?lol thx for the help Reply With Quote
  14. i juste noticed that it works without the{} to thx for the quick reply
  15. 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..
  16. 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
  17. 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?
  18. i fixed it by putting the right table.. but it brings out nothing only name ,phone,email..
  19. 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>
  20. 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.
  21. no i just have to make the echo look nicer..lol
  22. i got it going thx! <? $USERNAME = $_COOKIE['LMUSERNAME']; ?>
  23. 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
  24. 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 ?>
×
×
  • 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.