Jump to content

xoligy

Members
  • Posts

    232
  • Joined

  • Last visited

    Never

Everything posted by xoligy

  1. echo '</select></td></tr> <tr><td>Subject:</td><td><input type="text" name="subject" id="subject" size="59" /></td></tr> <tr><td>Message:</td><td><textarea name="message" cols="45" rows="5" value="'.$error['message'].'"></textarea></td></tr> <tr><td></td><td><input type="submit" name="send" value="Send!" /></td></tr> </table> </form> Try now </fieldset>';
  2. Im no coder but im bettin its just $text1 = mysql_real_escape_string(nl2br($post['text'])); As for the <br> tags there is a way of removing them but im not quite sure how so pass :-P
  3. Try changing the rq[0] to $rq[0] the [x] refers to the colum in the db (id, name, password, email = 0, 1, 2, 3 or there name)
  4. Thanks for that ajlisowski! Never seen that done in a tut
  5. Take it what i want isn't possible then :/
  6. Items table: Id | Item | Price | Img Useritems Id | Item_id | User_id | Qty So you have the items in one table and then when the user buys an item its added to the useritems table so if user brough 5x solidy gold bar in user items it would be inserted in user items as id: normally as a key auto increm item id: 2 user id: whatever there user id is (i use there id number) qty: 5 You then link it to the purchase screen. Hope that makes sense
  7. Your missing the end bracket "}" for and else statment which starts on line 757 else if ($sale_step == 'settings') /* settings page */ { Well that what phped says canna say wheere it goes im not that advanced :-P
  8. <?php include("poll_wags.php"); ?> http://thetop10women.com/poll_wags.php
  9. Ok i have tried a few variations of this code and all have come out the same it will show me the records of the selected numbers but i dont want that i want the ones not equal to them lol So i want it to display all the records in misisons where miss_id (in comp) is not equal to id (in missions) thought it be simple but i just get a blank table lol here is the funky code "select missions.id, missions.mission,missions.location, missions.level, missions.loot, missions.energy, missions.energy1, missions.bronze, missions.silver, missions.gold, missions.platinum, comp.miss_id, comp.user_id, comp.completed from missions, comp where comp.user_id=1 and comp.miss_id=missions.id"
  10. Thanks jt for having a look into it, after playing with the code i did sort it out was having a dumb moment i guess. I will definatly be having a deeper look into the unnecassary code removal tho that was interesting not seent hat in a tutoral yet Only isses i had with your code were... 1. table header was being showed on the links page (easily removed tho) 2. links still being showed here was all i had to do: <?php $action=$_GET['action']; if($action!=''){ echo'';}else{ ?> <table> <tr> <td><a href='missions.php?action=all'>All</a></td> </tr> <tr> <td><a href='missions.php?action=bronx'>Bronx</a></td> </tr> <tr> <td><a href='missions.php?action=downtown'>Downtown</a></td> </tr> <tr> <td><a href='missions.php?action=jersey'>Jersey</a></td> </tr> <tr> <td><a href='missions.php?action=vegas'>Las Vegas</a></td> </tr> <tr> <td><a href='missions.php?action=miami'>Miami</a></td> </tr> <tr> <td><a href='missions.php?action=chinatown'>Chinatown</a></td> </tr> </table> <?}?> Thanks again, now for me to play with the code remval i guess for smaller pages
  11. That table is what the user see's first, they then click what they want from that table and the correct table is displayed, but i dont want that table displayed after they have clicked it... i'll keep playing with it thanks
  12. Sure! <?php session_start(); if (!isset($_SESSION['username'])) { header("Location: login.php"); } include('db.php'); include('process.php'); ?> <title><?=$title?></title> <link rel="stylesheet" href="style.css" type="text/css" media="screen" /> <div id="container"> <div id="header"> <h1> Site name </h1> </div> <div id="navigation"> <ul> <li><a href="index.php">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">Services</a></li> <li><a href="#">Contact us</a></li> </ul> </div> <div id="content-container"> <div id="section-navigation"> <ul> <?include'left.php';?> </ul> </div> <div id="content"> <? if($action=='all'){ $missions = mysql_query("select * from missions"); echo "<table border='1' width='750px'>"; echo "<tr><td colspan='9' align='center'>Missions</td></tr>"; echo "<tr><td>Mission</td><td>Level</td><td>Location</td><td>Loot</td><td>Total Ngy</td><td>bronze</td><td>bronze</td><td>bronze</td><td>bronze</td></tr>"; while($row = mysql_fetch_array( $missions )) { echo "<tr><td>".$row['mission']."</td><td>".$row['level']."</td><td>".$row['location']."</td><td>".$row['loot']."</td><td>".$row['energy1']."</td><td>".$row['bronze']."</td><td>".$row['silver']."</td><td>".$row['gold']."</td><td>".$row['platinum']."</td></tr>"; } echo "</table>"; } if($action=='bronx'){ $missions = mysql_query("select * from missions where location='bronx'"); echo "<table border='1' width='750px'>"; echo "<tr><td colspan='9' align='center'>Missions</td></tr>"; echo "<tr><td>Mission</td><td>Level</td><td>Location</td><td>Loot</td><td>Total Ngy</td><td>bronze</td><td>bronze</td><td>bronze</td><td>bronze</td></tr>"; while($row = mysql_fetch_array( $missions )) { echo "<tr><td>".$row['mission']."</td><td>".$row['level']."</td><td>".$row['location']."</td><td>".$row['loot']."</td><td>".$row['energy1']."</td><td>".$row['bronze']."</td><td>".$row['silver']."</td><td>".$row['gold']."</td><td>".$row['platinum']."</td></tr>"; } echo "</table>"; } if($action=='downtown'){ $missions = mysql_query("select * from missions where location='downtown'"); echo "<table border='1' width='750px'>"; echo "<tr><td colspan='9' align='center'>Missions</td></tr>"; echo "<tr><td>Mission</td><td>Level</td><td>Location</td><td>Loot</td><td>Total Ngy</td><td>bronze</td><td>bronze</td><td>bronze</td><td>bronze</td></tr>"; while($row = mysql_fetch_array( $missions )) { echo "<tr><td>".$row['mission']."</td><td>".$row['level']."</td><td>".$row['location']."</td><td>".$row['loot']."</td><td>".$row['energy1']."</td><td>".$row['bronze']."</td><td>".$row['silver']."</td><td>".$row['gold']."</td><td>".$row['platinum']."</td></tr>"; } echo "</table>"; } if($action=='jersey'){ $missions = mysql_query("select * from missions where location='jersey'"); echo "<table border='1' width='750px'>"; echo "<tr><td colspan='9' align='center'>Missions</td></tr>"; echo "<tr><td>Mission</td><td>Level</td><td>Location</td><td>Loot</td><td>Total Ngy</td><td>bronze</td><td>bronze</td><td>bronze</td><td>bronze</td></tr>"; while($row = mysql_fetch_array( $missions )) { echo "<tr><td>".$row['mission']."</td><td>".$row['level']."</td><td>".$row['location']."</td><td>".$row['loot']."</td><td>".$row['energy1']."</td><td>".$row['bronze']."</td><td>".$row['silver']."</td><td>".$row['gold']."</td><td>".$row['platinum']."</td></tr>"; } echo "</table>"; } if($action=='vegas'){ $missions = mysql_query("select * from missions where location='las vegas'"); echo "<table border='1' width='750px'>"; echo "<tr><td colspan='9' align='center'>Missions</td></tr>"; echo "<tr><td>Mission</td><td>Level</td><td>Location</td><td>Loot</td><td>Total Ngy</td><td>bronze</td><td>bronze</td><td>bronze</td><td>bronze</td></tr>"; while($row = mysql_fetch_array( $missions )) { echo "<tr><td>".$row['mission']."</td><td>".$row['level']."</td><td>".$row['location']."</td><td>".$row['loot']."</td><td>".$row['energy1']."</td><td>".$row['bronze']."</td><td>".$row['silver']."</td><td>".$row['gold']."</td><td>".$row['platinum']."</td></tr>"; } echo "</table>"; } if($action=='miami'){ $missions = mysql_query("select * from missions where location='miami'"); echo "<table border='1' width='750px'>"; echo "<tr><td colspan='9' align='center'>Missions</td></tr>"; echo "<tr><td>Mission</td><td>Level</td><td>Location</td><td>Loot</td><td>Total Ngy</td><td>bronze</td><td>bronze</td><td>bronze</td><td>bronze</td></tr>"; while($row = mysql_fetch_array( $missions )) { echo "<tr><td>".$row['mission']."</td><td>".$row['level']."</td><td>".$row['location']."</td><td>".$row['loot']."</td><td>".$row['energy1']."</td><td>".$row['bronze']."</td><td>".$row['silver']."</td><td>".$row['gold']."</td><td>".$row['platinum']."</td></tr>"; } echo "</table>"; } if($action=='chinatown'){ $missions = mysql_query("select * from missions where location='chinatown'"); echo "<table border='1' width='750px'>"; echo "<tr><td colspan='9' align='center'>Missions</td></tr>"; echo "<tr><td>Mission</td><td>Level</td><td>Location</td><td>Loot</td><td>Total Ngy</td><td>bronze</td><td>bronze</td><td>bronze</td><td>bronze</td></tr>"; while($row = mysql_fetch_array( $missions )) { echo "<tr><td>".$row['mission']."</td><td>".$row['level']."</td><td>".$row['location']."</td><td>".$row['loot']."</td><td>".$row['energy1']."</td><td>".$row['bronze']."</td><td>".$row['silver']."</td><td>".$row['gold']."</td><td>".$row['platinum']."</td></tr>"; } echo "</table>"; } if($action=='coney island'){ $missions = mysql_query("select * from missions where location='coney island'"); echo "<table border='1' width='750px'>"; echo "<tr><td colspan='9' align='center'>Missions</td></tr>"; echo "<tr><td>Mission</td><td>Level</td><td>Location</td><td>Loot</td><td>Total Ngy</td><td>bronze</td><td>bronze</td><td>bronze</td><td>bronze</td></tr>"; while($row = mysql_fetch_array( $missions )) { echo "<tr><td>".$row['mission']."</td><td>".$row['level']."</td><td>".$row['location']."</td><td>".$row['loot']."</td><td>".$row['energy1']."</td><td>".$row['bronze']."</td><td>".$row['silver']."</td><td>".$row['gold']."</td><td>".$row['platinum']."</td></tr>"; } echo "</table>"; } if($action=='moscow'){ $missions = mysql_query("select * from missions where location='moscow'"); echo "<table border='1' width='750px'>"; echo "<tr><td colspan='9' align='center'>Missions</td></tr>"; echo "<tr><td>Mission</td><td>Level</td><td>Location</td><td>Loot</td><td>Total Ngy</td><td>bronze</td><td>bronze</td><td>bronze</td><td>bronze</td></tr>"; while($row = mysql_fetch_array( $missions )) { echo "<tr><td>".$row['mission']."</td><td>".$row['level']."</td><td>".$row['location']."</td><td>".$row['loot']."</td><td>".$row['energy1']."</td><td>".$row['bronze']."</td><td>".$row['silver']."</td><td>".$row['gold']."</td><td>".$row['platinum']."</td></tr>"; } echo "</table>"; } ?> <table> <tr> <td><a href='missions.php?action=all'>All</a></td> </tr> <tr> <td><a href='missions.php?action=bronx'>Bronx</a></td> </tr> <tr> <td><a href='missions.php?action=downtown'>Downtown</a></td> </tr> <tr> <td><a href='missions.php?action=jersey'>Jersey</a></td> </tr> <tr> <td><a href='missions.php?action=vegas'>Las Vegas</a></td> </tr> <tr> <td><a href='missions.php?action=miami'>Miami</a></td> </tr> <tr> <td><a href='missions.php?action=chinatown'>Chinatown</a></td> </tr> </table> </div> <div id="footer"> <a href="http://www.maxdesign.com.au/articles/css-layouts/three-fixed/">max design layout</a> </div> </div> </div>
  13. Sorry should of posted an image of what i ment, i suppose the " " would work yes, and i guess i could add a condition that if the field is empty to echo " " in that empty field? Anyway here is a screenshot of the table and very basic site one row has the suggested answer in the first row and the second row how it normally would look (guess this issue is solved) http://img515.imageshack.us/img515/9631/whitespaces.png Next question is, im doing things by clicking a link 'missions.php?action=whatever' and the page displays the info required. Is tehre away to remove the links from the bottom without it messing up the layout? exit; } removes the css footer.
  14. Ok i have used a form to enter data into the db, now some of the fields i had to enter are blank. So when i called back the data from the db into a table i have horrid white spaces, whats the best way to deal with these? Calling the data: $missions = mysql_query("select * from missions where location='jersey'"); echo "<table border='1' width='750px'>"; echo "<tr><td colspan='9' align='center'>Missions</td></tr>"; echo "<tr><td>Mission</td><td>Level</td><td>Location</td><td>Loot</td><td>Total Ngy</td><td>bronze</td><td>bronze</td><td>bronze</td><td>bronze</td></tr>"; while($row = mysql_fetch_array( $missions )) { echo "<tr><td>".$row['mission']."</td><td>".$row['level']."</td><td>".$row['location']."</td><td>".$row['loot']."</td><td>".$row['energy1']."</td><td>".$row['bronze']."</td><td>".$row['silver']."</td><td>".$row['gold']."</td><td>".$row['platinum']."</td></tr>"; } Entering the data: if (!function_exists("cln")) { function cln( $value ){ if( get_magic_quotes_gpc() ){ $value = stripslashes( $value ); } //check if this function exists if( function_exists( "mysql_real_escape_string" ) ) { $value = mysql_real_escape_string(trim(strip_tags(htmlspecialchars(( $value ))))); } //for PHP version < 4.3.0 use addslashes else { $value = addslashes( $value ); } return $value; } } if($addmission){ $mission = cln($mission); $location = cln($location); $loot = cln($loot); $level = cln($level); $energy = cln($energy); $energy1 = cln($energy1); $bronze = cln($bronze); $silver = cln($silver); $gold = cln($gold); $platinum = cln($platinum); $result = mysql_query("INSERT INTO `missions` (`id`, `mission`, `location`, `loot`, `level`, `energy`, `energy1`, `bronze`, `silver`, `gold`, `platinum`) VALUES (NULL, '".$mission."', '".$location."', '".$loot."', '".$level."', '".$energy."', '".$energy1."', '".$bronze."', '".$silver."', '".$gold."', '".$platinum."')") or die (mysql_error()); //echo $result; } Thanks for any help in advance
  15. Ok here is the situation im creating a page that is going to display database informtation (hopefully) now i want this page to be searchable and ordable (yes there not words i know) and wondered if this would work with php or not? If it does do i need to download anything to get it to work or not i dont have a clue lol Also, if anyone knows of any others, or maybe one better/easier to use then please do let me know and i shall have a look at it. Im a noob to all languages but get things working int he end with a little help from you folks! http://www.datatables.net/
  16. The table is incomplete. this: shout_id MEDIUMINT( UNSIGNED NOT NULL auto_increment, should be soemting like this: shout_id MEDIUMINT(50) UNSIGNED NOT NULL auto_increment, there are a few like this if you look through it, there are just numbers missing, fill them in with what you think are necassary well i think thats the problem just re-checked the first post maybe im wrong :/
  17. Is it possible to count the rows of 5/6 tables and then return the result? Everything ive looked at dont look right lol all the tables are identicle just the names and the data entered is different. Here is how the db looks Table > setup Melee - id, item, att, def, limited Guns - id, item, att, def, limited another anothre Break down: id - primary key, auto inc. item - name att/def numbers limited - is either blank, favor, blackmarket etc etc Now i want to count all records in limited that are = to "favor" in all tables, is this possible or am i going to need seperate querys then add them up? Just thought maybe db doing it be better tho i could be wrong
  18. Thanks for that will look it up. @Haku, like i said i thought a div would class as a css question. Divs are more or less useless without any css! What would be the point in me using div tags without any css? answer... there would be no use!
  19. Thanks Mchl! i'll look it over and see what was wrong So adding "mysql_query("")" waws the problem ok lol thanks
  20. Ok the query works in phpmyadmin but soon as i add it to the php i get Resource id #24 can someone tell me whats up or explain? What i want, is for the query to count how many of an item the user has so if a user had 10 of id 1 and then 20 of id 5 it would echo the quantity. Im sure i could make it more complecated but i dont think thats necassary Breakdown: Weapon info is stored in Melee. Userweapons is how many of each weapon the user has which is matched up to melee "id" via "item_id" The user is matched by "user_id" and in this query id 1 will be changed to "$id" Hope this makes sense $qty = mysql_query("select melee.item, userweapons.item_id, userweapons.qty, userweapons.user_id from melee, userweapons where melee.id = userweapons.item_id and userweapons.user_id=1"); $result = mysql_query($qty) or die(mysql_error()); // Print out the contents of each row into a table while($row = mysql_fetch_array($result)){ echo $row['item_id']. " - ". $row['qty']; echo "<br />"; }
  21. So div tags are not css? Oh sorry my bad then, i'll just copy the code over and over i guess then add the "css" at the top of the page via a file. You see with div tags being controlled by css i thought that div tags would class as css not html
  22. Yeh i understand that but this is what i mean below is the code im considering using which is from http://www.maxdesign.com.au now do i need to repeat that on to every page then insert my data into the "content-container" everytime, or is there a way for my main content to appear there somehow when the appropiate link is clicked? thats whats confusing me sorry. The site will be php and css hopefully, just getting fed up of a white page with all data lol <div id="container"> <div id="header"> <h1> Site name </h1> </div> <div id="navigation"> <ul> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">Services</a></li> <li><a href="#">Contact us</a></li> </ul> </div> <div id="content-container"> <div id="content"> <h2> Page heading </h2> <p> Lorem ipsum dolor sit amet consect etuer adipi scing elit sed diam nonummy nibh euismod tinunt ut laoreet dolore magna aliquam erat volut. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. </p> <p> Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </p> <p> Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. </p> </div> <div id="aside"> <h3> Aside heading </h3> <p> Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan. </p> </div> <div id="footer"> Copyright © Site name, 20XX </div> </div> </div>
  23. Ok ive been having a look arounf at 2col layouts and i see how there coded etc etc and think ok i can learn that no problem! Anyway here is my confusion, do i need the css on EVERY page or can i have one page and then call the pages tha i require? and it opens in the content area? Or is that still limited to the sexy tables.. yes im css noob
  24. Thanks to this its solved my issue thanks! http://www.phpfreaks.com/forums/index.php/topic,288800.msg1368737.html#msg1368737
×
×
  • 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.