Jump to content

rootKID

Members
  • Posts

    467
  • Joined

  • Last visited

Everything posted by rootKID

  1. yes, and sorry for late reply,... i have fixed it now, i asked a teacher today... they answered my question ... i just needed to type it a little diffrently ...
  2. yoyo dudes, i have a little trouble with my login page... here is my godes with my errors: /*TEST #2*/if(isset($_POST['login_submit'])){$uname = $_POST['username']; //Form Name...$pass = $_POST['password']; //Form Name...if(isset($uname_checker)){$uname_stripped = strip_tags($uname);$pass_stripped = strip_tags($pass);header('location:succes_loader.php?login_checker=1');}else{$error_login_text = "Unknown username or password!...";}$query="SELECT * FROM user_login WHERE username ='$uname_stripped' && password='$pass_stripped'";$result=mysql_query($query);//kører forespørgsel$row = mysql_fetch_array($result);$_SESSION['uid'] = $row['user_id'];$_SESSION['user_name'] = $row['username'];$_SESSION['user_password'] = $row['password'];$_SESSION['u_email'] = $row['user_email'];echo "<fieldset><legend>Login Error!</legend>$error_login_text</fieldset><br>";}//End login_submit./*TEST #2*/ -------------------------------------------------------Error messeage here: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\speedscene\login.php on line 53 and yes, i am connected to db... ... ideas would be greate! ... PS: if i wish to make sha1 protection for my users... how to write on signup page and on login page?... thanks alot! ...
  3. just echo it on the page orr use a print_r() with post/get... depends on what you use ...
  4. @Joostk - just goto the real website of w3schools... they have greate tutorials about .css... including the image css your talking about... normally i would do somfthing like this: img {margin-bottom: 10px; /*you can change this if liked...*/} and then it would do it for you... but it does that on all of the images, if needing this on one seperate set of images, then make a div box with a class/id around them, and then put a #''div box id name here...' and then at end of that the img, and then it will only do for those images inside that div ... it is actually that easy ... but ok, i also had a little trouble understanding the image part when i first began to code... so it is understand able ... in anyways... try read up on it!... there are greate tutorials on w3schools website!... just need to find them ...
  5. rootKID

    New to this

    i think its wordpress to ... just a modified one ...
  6. hello w3s again... i have trouble again with a self project, and this time (like allways) i have no clue why it does this... 1. i have some files like so given in picture: ATTACHED now inside the bittorrent.php file, i have my whole site defined in functions like so: <?php/*=========================*/$mysql_host = "localhost";$mysql_user = "root";$mysql_pass = "daniel1";$mysql_db = "ss_2012";$db_details = mysql_connect($mysql_host, $mysql_user, $mysql_pass);mysql_select_db($mysql_db, $db_details)or die(mysql_error());/*=========================*/function stdhead($title = "",$css_file = ""){$stdhead_start .="<!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=iso-8859-1' /><link rel='stylesheet' type='text/css' href='styles/".$css_file.".css'/><link rel='shortcut icon' href='fav_icon.ico' /><title>".$title."</title></head><body>"; $stdhead_start .="<table class='banner_table' align='center' cellpadding='0'><tr><td><a href='index.php'><img src='styles/images/banners/banner.png' width='1000' height='140' alt='SS_2012' /></a></td></tr></table>"; $stdhead_start .="<table class='status_table' align='center'><tr><td class='status_left'>LEFT</td><td class='status_right'>RIGHT</td></tr></table>"; $stdhead_start .="<table class='menu_table' border='0' align='center'><tr><td class='navigation'><a href='index.php'>HOME</a></td><td class='navigation'><a href='browse.php'>BROWSE</a></td><td class='navigation'><a href='upload.php'>UPLOAD</a></td><td class='navigation'><a href='request.php'>REQUESTS</a></td><td class='navigation'><a href='chat.php'>CHAT</a></td><td class='navigation'><a href='forums.php'>FORUM</a></td><td class='navigation'><a href='guides.php'>GUIDES</a></td><td class='navigation'><a href='bonus.php'>BONUS</a></td><td class='navigation'><a href='rules.php'>RULES</a></td><td class='navigation'><a href='faq.php'>FAQ</a></td><td class='navigation'><a href='links.php'>LINKS</a></td><td class='navigation'><a href='support.php'>SUPPORT</a></td></tr></table>"; $stdhead_start .="<table class='main_table' align='center'><tr><td>";return $stdhead_start;}//stdhead ends... function stdfooter(){$stdfoot_start ="</td></tr></table> <table class='foot_table' align='center'> <tr> <td>Speed-Scene © 2012 -> Revision 01</td> </tr> </table> </body> </html>"; return $stdfoot_start;}//stdfooter ends... /*====================FUNCTIONS PLACE!...====================================*/ function tr($x,$y,$noesc=0) {if ($noesc) $a = $y;else { $a = htmlspecialchars($y); $a = str_replace("\n", "<br />\n", $a);}print("<tr><td class=\"heading\" valign=\"top\" align=\"right\">$x</td><td valign=\"top\" align=left>$a</td></tr>\n");} function genrelist() {$ret = array();$res = mysql_query("SELECT id, name FROM categories ORDER BY name");while ($row = mysql_fetch_array($res)) $ret[] = $row;return $ret;} function StatusBar(){echo "<table class='status_table' align='center'><tr><td class='status_left'>LEFT</td><td class='status_right'>RIGHT</td></tr></table>";}?> and when i replace the status bar place with the StatusBar() Function inside the head function, then i get this result here: http://speed-scene.c...wrong/login.php and when i have the normal text building writed inside the place, then i get the normal design as i wish it to be like this: http://speed-scene.c..._good/login.php now, what i am in a need of, is that if someone can explain me why the design is going to be screwed up with all stuff, the fonts size,the status over the banner, even when i have said to it that it should be under it... then its placing itself up there -.-'... and im calling the designs like so as a example on my login page: <?phprequire_once("include/bittorrent.php");echo stdhead("Login","1");?> This is the Login Page!... <?phpecho stdfooter();?> so now i have my final question here... what the heck am i doing wrong?... someone?... ideas?... EDIT: and no, im not trying to make a torrent tracker... just called the file bittorrent.php for that name because i was trying to follow a tutorial .. EDIT #2: Did i post the right place at all?... mean, should i post in css section instead? ...
  7. yeah, i did. but just if there where other places to look? .
  8. ohh, did not knew it was a framework... but thanks... and the other questions was if anyone in here could tell orr give me a good tutorial place if i need to make a design out of cakePHP, so i can give it to one of my friends that have promissed me to code the functionally of it when i have maked the design to it... .
  9. yoyo w3s...a question is needed to be answered... i have lately readed a little on to cakePHP... but i would like to know, if any in here think its better then normal PHP. and if so, then can anyone help me a little here?... because im trying to build up a design in it, so that an another coder from my mentor team online at ''World Wide Web'' ^^', can code the functionality to it... ideas?...and yes, i have downloaded latest version, just how to use it... i have tried to build up the simple blog at their main website, but it was a ###### without equal... that is why im asking here, when i now did not got my question in that tutorial answered... so... please answer ^^'...
  10. rootKID

    Redirecting

    there are also refresh as i was learned about inside these forums ... dont know if its usefull in your situation, but i would use it i think ... if not, well... use the header location as jsg told ya ...
  11. my question was if i could make a define like that (@so called). and birbal answered me on that part ... so, that is pretty much it guys, thanks for the clear up in my mind ...
  12. sorry for not explaining this in details, im still confuced myself, and yeah.. i could use the require_once orr include... but i needed to try somfthing diffrent, so that is why i asked ... like if i need it inside a long code, it would be nice to write (ROOT_INC),ect... just seemed it alot of places, just how to write it.. and yeah bb.. i did see this, but only on how to use it on number and such, but is it the same writing style?... EDIT: just a fast question, if i was going to write this... could i write like this: define("ROOT","include/");echo ROOT."config.php"; if so?...
  13. hello all from w3s again... i have seemed the PHP word ''Define''. now my questio is. if i have 2 files in my root, and 3 files in a folder called include, and one of those inside include folder is called main_design.php. and called by 2 functions like so inside all the other files inside root...: function stdhead($title = "",$css_file = ""){$stdhead_start = "<!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=iso-8859-1' /><link rel='stylesheet' type='text/css' href='styles/".$css_file.".css'/><link rel='shortcut icon' href='fav_icon.ico' /><title>".$title."</title></head><body><table class='banner_table' align='center' cellpadding='0'><tr><td><a href='index.php'><img src='styles/images/banners/banner.png' width='1000' height='140' alt='SS_2012' /></a></td></tr></table> <table class='menu_table' border='0' align='center'><tr><td class='navigation'><a href='index.php'>HOME</a></td><td class='navigation'><a href='browse.php'>TORRENTS</a></td><td class='navigation'><a href='index.php'>REQUESTS</a></td><td class='navigation'><a href='index.php'>BECOME UPLOADER</a></td><td class='navigation'><a href='index.php'>CHAT</a></td><td class='navigation'><a href='index.php'>FORUM</a></td><td class='navigation'><a href='index.php'>GUIDES</a></td><td class='navigation'><a href='index.php'>BONUS</a></td><td class='navigation'><a href='index.php'>RULES</a></td><td class='navigation'><a href='index.php'>FAQ</a></td><td class='navigation'><a href='index.php'>LINKS</a></td><td class='navigation'><a href='index.php'>SUPPORT</a></td></tr></table> <table class='main_table' align='center'><tr><td>";return $stdhead_start;}//stdhead ends... function stdfooter(){$stdfoot_start ="</td></tr></table> <table class='foot_table' align='center'> <tr> <td>Speed-Scene © 2012 -> Revision 01</td> </tr> </table> </body> </html>";return $stdfoot_start;}//stdfooter ends... and root files ect; <?phprequire_once("include/bittorrent.php");echo stdhead("Home","1");?>This is the Index Page!...<?phpecho stdfooter();?> now my question is, that if i have an another file inside include called config.php. and wish to make a define inside there... and after that, call it on one of the root files, so it would go inside the include folder, and then i just need to write the name of the file i need to have ect... how do i do this?... thanks in advance!
  14. yoyo w3...a little help would be awsome!... im trying to make my own little time shower in the top of my website... the only problem is that the codes does not work... i founded it on a open-source forum kinda... almost like this, just alot of hardcore coders, i suppose... anyways...here is my codes: function mkprettytime($s) { if ($s < 0) $s = 0; $t = array(); foreach (array("60:sec","60:min","24:hour","0:day") as $x) { $y = explode(":", $x); if ($y[0] > 1) { $v = $s % $y[0]; $s = floor($s / $y[0]); } else $v = $s; $t[$y[1]] = $v; } if ($t["day"]) return $t["day"] . "d " . sprintf("%02d:%02d:%02d", $t["hour"], $t["min"], $t["sec"]); if ($t["hour"]) return sprintf("%d:%02d:%02d", $t["hour"], $t["min"], $t["sec"]);// if ($t["min"]) return sprintf("%d:%02d", $t["min"], $t["sec"]);// return $t["sec"] . " secs";}function gmtime(){ return strtotime(get_date_time());}function get_dt_num(){ return gmdate("YmdHis");}// Returns the current time in GMT in MySQL compatible format.function get_date_time($timestamp = 0){ if ($timestamp) return date("Y-m-d H:i:s", $timestamp); else return gmdate("Y-m-d H:i:s");} and what i wish it to look like, would be somfthing like so: Monday - 23.42 - JULY,ECT... but the most important thing for me right now, is that i would like to get this one worked, since i think that it could be awsome to have it with me when i create a fully front-end that should be user-friendly for some ... Hoping some answers soon, regards... PS: i do not know if somfthing is missing orr like that, but dont think so... i got the following error by calling the function ''mkprettytime''...: Warning: Missing argument 1 for mkprettytime(), called in C:\xampp\htdocs\ss_tracker_2011\status_left.php on line 3 and defined in C:\xampp\htdocs\ss_tracker_2011\include\config.php on line 104 thanks in advance! ...
  15. hmm... did not think of it that way ^^'...
  16. thats true, i suggest looking into an another ISP ... if you asking me at least ...
  17. does it ''NEEDS'' to be between the 2 echoes?... the sleep?, i mean... before it will work?.
  18. i dont either... sorry... :/.
  19. same here... actually cool idea to think of! ...
  20. one question getty... what does sleep?.... and sorry for late reply, have been in the schools all day... and im so tired right now ...anyways... niche, why... simple... i suppose you have allready seemed my shop website trouble... anyways... i need this in my order_adding.php file, so that the product/order is going to be added, but in the background, while redirecting to an another location after done, and meanwhile on the page, showing the word ''Product Added''... orr somfthing like that... still working on it ...
  21. Hello... the title says it all... how to make a header() location, just after some coble of seconds?...
  22. EDIT: lol...we have located the problem... it was the submit place... i have created 2 forms... so the submit in a form for itself, in that case it did not submit the other form with the products -.-'... so case closed ...
  23. sorry jsg... did not see that part as a must add... but added now, and getting those errors: Notice: Undefined index: cat_id in C:\xampp\htdocs\shop\shop.php on line 97You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Here are code... tell me... i did insert it right this time, right?: <?phpecho "<pre>";print_r($_SESSION);echo "</pre>"; include ("shop_categories.php");echo "<br />";var_dump($_GET); /*$catID checking...*/if (isset($_GET['cat_id'])){$catID = intval($_GET['cat_id']);}else{$catID = 0;}/*$catID = isset($_GET['cat_id']) ? $_GET['cat_id'] : 0;*//*$catID checking...*/if(isset($catID)){$query = "SELECT * FROM shop_items WHERE FK_catID = " . $_GET['cat_id'];}else {$query = "SELECT * FROM shop_items";}$result = mysql_query($query)or die(mysql_error()); /*ECHO THE CAT_ID FOR SEEING IF ANYTHING COMES OUT...*/if(!$catID == ""){echo "Succes! [CAT_ID ECHO]";}else {echo "Noob! [CAT_ID ECHO]";}echo $catID;/*ECHO THE CAT_ID FOR SEEING IF ANYTHING COMES OUT...*/ if(mysql_num_rows($result)>0)//Checking to see if there is any rows to take...{echo "<form action='' method='post'>\n";echo "<table class='shop_table_100'>\n";echo "<tr class='shop_tr_holder_css'>\n";echo "<td>Add</td>\n";echo "<td>Amount</td>\n";echo "<td>Product Name</td>\n";echo "<td>Price</td>\n";echo "<td>More Info</td>\n";echo "</tr>\n"; while ($row = mysql_fetch_assoc($result)){echo "<tr>\n";echo "<td><input type='checkbox' name='check_addbox[".$row['item_id']."]' /></td>\n"; ////extra array...echo "<td><input type='text' name='amount[".$row['item_id']."]' size='1' value='1' /></td>\n"; //With extra array...echo "<td>".$row['item_name']."</td>\n";echo "<td>".$row['item_price']." USD</td>\n";echo "<td><a href='shop_details.php?item_id=".$row['item_id']."'>Info</a></td>\n";echo "</tr>\n";}echo "</table>\n";echo "</form>\n"; echo "<form action='' method='post'>\n";echo "<table class='shop_table_100'\n";echo "<tr>\n";echo "<td><input type='submit' name='add_item' id='submit' class='shop_add_submit_button' value='Update Cart' /></td>\n";echo "</tr>\n";echo "</table>\n";echo "</form>\n"; }//Ending IF (Num_Rows...)else{echo "<form action='' method='post'>\n";echo "<table class='shop_table_100'>\n"; echo "<tr class='shop_tr_holder_css'>\n";echo "<td>ERROR!</td>\n";echo "</tr>\n"; echo "</table>\n";echo "</form>\n"; echo "<form action='' method='post'>\n";echo "<table class='shop_table_100'>\n"; echo "<tr>\n";echo "<td>There are no Products to show yet.</td>\n";echo "</tr>\n"; echo "</table>\n";echo "</form>\n";} if(isset($_POST['add_item'])){if(!empty($_POST['check_addbox'])){ foreach($_POST['check_addbox'] as $p_id => $check) { $amount = $_POST['amount'][$p_id]; //Getting the Amount from the box... [p_id] is indicating what product it is (the checkbox...) $_SESSION['cart'][$p_id] += $amount; //adding them to the session... header("location: shop.php"); }}}?> EDIT: im going to bed for today, im going up early tomorrow... asking my teachers about this tomorrow also... maybe they can help me on the road again... in anyway, ill post a feedback tomorrow if they did not. and well, if they did... im still going to post feedback ... see ya tomorrow ...Regards... (From Cellphone...)
×
×
  • Create New...