Jump to content

adam_bray

Members
  • Posts

    101
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by adam_bray

  1. Find where that query is coming from and post the .php file here (in code tags), preferably only the relevant section / lines. The code you posted above is just your query function, it has nothing to do with the problem.
  2. Is the first part of the query yours? SELECT p.id as parentID, p.name as parentName, p.description, p.logo as parentLogo, p.parent, p.active FROM com_catalogue_category p LEFT JOIN com_catalogue_category c ON (c.id = p.parent) WHERE p.id = '56' If so then it looks like you need to secure your queries as someone has tried to run a second query to get user details from a user table. union select concat(0x5E252421,ifnull(`id`,0x4E554C4C),char(9),ifnull(`email`,0x4E554C4C),char(9),ifnull(`password`,0x4E554C4C),char( 9),0x2A5B7D2F),2 from `maver_user`.`users` where email like 0x252E25 limit 1498,1 -- And '6'='6'
  3. Move your query between $safe_email = mysqli_real_escape_string($email); // QUERY GOES HERE } You've got it in a place that will run the query every time the page is loaded, even before the form is submit.
  4. Looks like you're getting the idea. All that's missing for the header to work is a width. If you do this then it'll work - #headerimage { margin: 0 auto; width: 90%; } Also, with margin: 0 auto; it's using the web developers compass.. meaning the margin is being assigned like so - margin: top right bottom left; /*Explanation line - invalid code*/ margin: 0 auto 0 auto; So by assigning 0 & auto you're saying the vertical margin = 0 and the horizontal margin = auto (it repeats if you only specify one vertical or one horizontal rule). In your code you want a 130px top margin, you can do that like so - margin: 130px auto 0; /*use this*/ Which translates to margin: 130px auto 0 auto; /*OR*/ margin-top: 130px; margin-right: auto; margin-bottom: 0; margin-left: auto;
  5. The problem with what you have now is that it's not very flexible, which is what you've identified yourself. Using margins and positioning like you have is a strange way to build the page. Typically the layout you're trying to build can be done simply with 3 floated elements inside a centered container. Here's a quick codepen with the basic code - http://codepen.io/lawnch/pen/xsqfJ/ I also have a layout tutorial on my blog if you want a longer explanation - here.
  6. What's wrong with resizing the browser window? Look at CSS media queries to handle different screen sizes with devices such as tablets and smartphones. A couple of things with your code - To center align items with CSS you should use margin: 0 auto; the method you're using now doesn't work on smaller screens <p> elements should be used for different paragraphs, not to simply wrap a whole block of text. Where you're using <br /><br /> between different paragraphs, you should simply end one paragraph and start the next. Your navigation should really be in a list, rather than <a>'s on their own
  7. That'll be down to the CSS positioning. I've got a feeling the images could be sitting on-top of each other. You need to edit this line so they're displayed how you need them - $style = ( $whichCount > 9 ) ? 'position: absolute; left:0%; top:0; width:100%;' : 'position: absolute; left:-100%; top:0; width:100%;';
  8. Your code is all over the place with some basic HTML errors. I've rewritten it as a one off so you can see the differences - I've even added some responsive CSS rules. I suggest going back and reading up about HTML page structure, HTML 5 standards, and about CSS positioning. Let me know if you have any questions (you'll need to rename the linked CSS file to whatever you want) - <!doctype html> <html> <head> <meta charset="UTF-8"> <title>Noskiw's Website</title> <script type='text/javascript' src='http://www.noskiw.co.uk/tests/private/inc/JS/jQuery/jquery-2.0.3.js'></script> <script type='text/javascript' src='http://www.noskiw.co.uk/tests/private/inc/JS/jQuery/functions/textSizeFunctions.js'></script> <script type='text/javascript'>CookiesDisclaimerHeaderSlideDown();FadeInCookiesDisclaimer();</script> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <link href="css_bug_1.css" rel="stylesheet" type="text/css" media="screen"> </head> <body> <noscript> <div class="row"> <div class="col-1"><p>Javascript is required for this website to function properly, please enable it and refresh the page, thank you</p></div> </div> </noscript> <div class="wrapper"> <header id="mainHead" class="clear"> <nav class="col-2-3"> <ul> <li class="active"> <a href='/'><img src='http://www.noskiw.co.uk/tests/private/inc/images/home.png' class='homeImg' alt='Home' /><span>Home</span></a> </li> <li> <a href='/about'><img src='http://www.noskiw.co.uk/tests/private/inc/images/about.png' class='aboutImg' alt='About Me' /><span>About Me</span></a> </li> <li> <a href='/blog'><img src='http://www.noskiw.co.uk/tests/private/inc/images/blog.png' class='blogImg' alt='Blog' /><span>Blog</span></a> </li> <li> <a href='http://twitter.com/noskiw' target="_blank"><img src='http://www.noskiw.co.uk/tests/private/inc/images/twitter.png' class='twitterImg' alt='Twitter' /><span>Twitter</span></a> </li> <li> <a href='/contact'><img src='http://www.noskiw.co.uk/tests/private/inc/images/contact.png' class='contactImg' alt='Contact Me' /><span>Contact Me</span></a> </li> </ul> </nav> <aside class="col-1-3"> <ul> <li style='font-size: small;'><a href='#' id='smallText'>A</a></li> <li style='font-size: large;'><a href='#' id='mediumText'>A</a></li> <li style='font-size: x-large;'><a href='#' id='largeText'>A</a></li> </ul> </aside> </header> <div id="mainContent" class="clear"> <div class="row"> <div class="col-1-3"> <h2>Latest Blog Post</h2> <article> <header><h4><a href='./blog/?post_id=1'>FIRST!</a></h4></header> <section> <p>This is the first post in the blog</p> </section> </article> </div> <div class="col-1-3"> <h2>About Me</h2> <p>This is the about me section.</p> </div> <div class="col-1-3"> <h2>Previous Work</h2> <p>This is where all the previous work for all the fucking stupid shit I've done before I made this website will go, I'm really only testing out the TD width thingy right now</p> </div> </div> </div> <footer> <p>Copyright © 2014</p> <p>By using this site you agree to our <a href="/cookies/">cookie policy</a>.</p> </footer> </div> </body> </html> @charset "UTF-8"; /* CSS Document */ /*RESET*/ * { margin: 0; outline: none; padding: 0; transition: color ease 400ms, background-color ease 400ms, opacity ease 400ms; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } *:after, *:before { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } html { font-size: 16px; height: auto !important; height: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } /*CLEARFIX*/ .clear {display: block; } .clear::after {clear: both;content: ".";display: block;height: 1px;visibility: hidden;} body { background-color: #1F1F1F; font-family: 'Helvetica Neue', sans-serif; height: 100%; margin: 0; padding: 0; } @media (min-width: 72rem) { html { font-size: 18px; } } h1, h2, h3, h4 { color: rgb(51, 51, 50); font-weight: 500; margin: 0 0 .35rem; } h1 {font-size: 1.5rem;} h2 {font-size: 1.35rem;} h3 {font-size: 1.1rem;} a { color: #FF6600; } a:hover { color: #C64F00; } div.wrapper { margin: 0 auto; min-width: 820px; width: 100%; } /*GRID*/ .row { display: block; } [class*="col-"] { display: block; float:left; margin: 0 0 0 1.6%; } [class*="col-"]:first-of-type { margin: 0; } .col-1 { width: 100%; } .col-2-3 { width: 66.1%; } .col-1-3 { width: 32.2%; } /*HEADER STYLES*/ header#mainHead { background: -webkit-linear-gradient(#FF6600, #C64F00); background: -o-linear-gradient(#FF6600, #C64F00); background: -moz-linear-gradient(#FF6600, #C64F00); background: linear-gradient(#FF6600, #C64F00); color: #FFFFFF; height: 80px; line-height: 80px; } header#mainHead ul { list-style-type: none; } header#mainHead ul > li { display: inline-block; position: relative; } header#mainHead ul > li.active:after { border-bottom: 10px solid #fff; border-right: 10px solid transparent; border-left: 10px solid transparent; bottom: 0; content: ""; display: inline-block; height: 0; left: 50%; margin: 0 0 0 -10px; position: absolute; width: 0; vertical-align: middle; } header#mainHead ul > li > a { color: white; display: block; padding: 0 22px; text-decoration: none; } header#mainHead ul > li > a > span { display: none; } header#mainHead > nav > ul > li:hover > a { background-color: rgba(0,0,0,.1); } header#mainHead ul > li > a > img { vertical-align: middle; width: 60px; } header#mainHead ul > li:hover > a > img { opacity: .5; } header#mainHead > aside > ul { text-align: right; } /*CONTENT*/ #mainContent { background: -webkit-linear-gradient(#FFFFFF, #DDDDDD); background: -o-linear-gradient(#FFFFFF, #DDDDDD); background: -moz-linear-gradient(#FFFFFF, #DDDDDD); background: linear-gradient(#FFFFFF, #DDDDDD); padding: 22px; } @media (min-width: 72rem) { #mainContent { padding: 36px 22px; } } #mainContent p { color: rgb(100, 101, 100); font-weight: 200; line-height: 1.5rem; } /*FOOTER*/ footer { background-color: rgba(255,255,255,.1); border-bottom: 1px solid rgba(0,0,0,.5); border-top: 1px solid rgba(0,0,0,.5); color: rgba(255,255,255,.5); font-size: .75rem; line-height: 1.7rem; padding: 11px 22px; } @media (max-width: 38rem) { .col-1, .col-1-3, .col-2-3 { margin: 1.6rem 0; width: 100%; } header#mainHead { height: auto; line-height: 70px; } header#mainHead aside { display: none; } header#mainHead nav li { display: block; } header#mainHead ul > li > a > span { display: block; } header#mainHead > nav > ul > li:hover > a { background-color: rgba(0,0,0,.1); } header#mainHead ul > li > a > img { display: none; } header#mainHead ul > li.active { background-color: rgba(0,0,0,.1); } header#mainHead ul > li.active:after { display: none; } div.wrapper { min-width: 360px; width: 100%; } }
  9. It's kinda hard to understand the problem without seeing the code you're aiming for. My shot in the dark is that your foreach loop is wrong and you're looping the whole slider instead of just the list-items. I would expect it to look something like - function putGrid( $pageid ) { global $_GRID_FRAMES_TABLE, $_GRID_TABLE, $_GRID_CROSS_GRID_FRAMES_TABLE, $_GRID_CROSS_PAGES_TABLE, $_HTTP_ADDRESS; $i = 0; $cpt = 1; $str = ''; $whichCount = 1; $query = mysql_query( 'SELECT * FROM'. $_GRID_CROSS_PAGES_TABLE .'WHERE id_page=\''.$pageid.'\';' )or die( 'Error:' . mysql_error()); $combineArr = mysql_num_rows( $query ); if( $combineArr > 0 ) // Do you want to know if there's actually results or just if the function worked? { $result = mysql_fetch_object( $query ); $grid = new Grid($result->id_grid); $str .= ' <div id="portfolio-slide'.$i.'" class="portfolio-slide"> <div class="portfolio-slide-inner"> <div class="portfolio-banner-content portfolio-banner-left"> <div class="portfolio-banner-header"></div> <div class="portfolio-banner-copy"> <ul id="gallery">'; foreach( $grid->getSwfMultiple() as $gridSwf ) { // Change the class and styles depending on the item $portfolioClass = ( $whichCount > 9 ) ? 'portfolio-active' : 'portfolio-inactive'; $style = ( $whichCount > 9 ) ? 'position: absolute; left:0%; top:0; width:100%;' : 'position: absolute; left:-100%; top:0; width:100%;'; // Loop the list items $str.= ' <li class="'.$portfolioClass.'" style="'.$style.'"><img src='.$_HTTP_ADDRESS.'grid_images/'.$gridSwf['image'].' /></li>'; $whichCount++; } $str.= ' </ul> </div> </div> </div> </div>'; $cpt++; } else { $str = '<div id="portfolio-slide" class="portfolio-slide">There are no results to display</div>'; } return $str; }
  10. The best place to start is with the query. Change $query = mysql_query("SELECT * FROM $_GRID_TABLE WHERE id_page='$pageid'"); To $query = mysql_query("SELECT * FROM $_GRID_TABLE WHERE id_page='$pageid'")or die('Error:' . mysql_error() . "SELECT * FROM $_GRID_TABLE WHERE id_page='$pageid'"); That should show any errors & show you the exact query that's being run. I'd suggest removing the crappy error code and replacing it with something a bit nicer once the error is sorted.
  11. It looks like you've over complicated the navigation. Firstly, you should have the links as an inline list (ul's and li's). With a list you can set a background image for the active element, so you won't need to position the triangle relative and move it around. Secondly, do you have a link to the original issue, the picture doesn't really show any issue? I'm sure if you recode it to use lists then it'll fix itself.
  12. Taking the example posted above, surely all you need to do is this - $query = "SELECT * FROM table"; $result = mysql_query($query); print '<table>'; while($row = mysql_fetch_assoc($result)) { print '<tr>'; print '<td>'.$row['id'].'</td><td>'.$row['description'].'</td><td>'.$row['date'].'</td></tr>'; } print '</table>';
  13. Where is $page_id being set? Also, you can use a MySQL JOIN to cut the query count to 1 - <?php if($stmt = $mysqli->prepare(' SELECT paginas.page_id , paginas.title , paginas.sub_title , paginas.content , menus.name AS menu_name , menus.menus_link FROM paginas LEFT OUTER JOIN menus ON menus.menu_id = paginas.menu_id WHERE paginas.menu_id=? ')) { $stmt->bind_param("s", $_GET['cat']); $stmt->execute(); $result = $stmt->get_result(); while( $row = $result->fetch_assoc() ) { // Page data $page_id = $row['page_id']; $title = $row['title']; $sub_title = $row['sub_title']; $content = $row['content']; // Menu data $menu_name = $row['menu_name']; $menu_link = $row['menu_link']; } echo '<h1>'.$title.'</h1> <h2>'.$sub_title.'</h2> <p>'.$content.'</p>'; $stmt->close(); } ?>
  14. The box-shadow of the other site is box-shadow: 0 1px 3px rgba(0,0,0,0.4); Using RGBA will tone down the shadow as it lowers the opacity, giving a slightly different effect to your original box-shadow.
  15. Increase the width of div.dollor to 220px Decrease the width of div.small_dollor to 595px
  16. Problem 1: You want to use the following CSS to center align elements - margin: 0 auto; I don't see the second issue, is it already fixed?
  17. #1 - It's not return = 1; it should be return 1; #2 - You've added a function just above where you want to use the code... what's the point? You're misunderstanding the use of OOP (functions and classes). I recommend following some tutorials on PHP + OOP to understand the uses better. #3 - Get used to indenting your code so it's easier to follow #4 - What are you getting overwhelmed with when using inputs?
  18. Like this - <?php if( $_SERVER['PHP_SELF'] == '/index.php' ) { print '<a href="page2.php">Go to page 2</a>'; } elseif( $_SERVER['PHP_SELF'] == '/page2.php' ) { print '<a href="index.php">Go Home</a>'; } ?>
  19. You want to use an IF statement with $_SERVER['php_self']
  20. the :after selector adds content after the specified element. The code provided adds an invisible "." below the contained content to act as a clearfix when using floated elements.
  21. <?php $timestamp = 1391021444; if($timestamp >= (time() - 5)) { echo "Less than 5 seconds"; } else { echo "More than 5 seconds"; } ?>
  22. No, the example has both. Looking through your code you have lots of different container elements doing similar things, then you use margins to push the columns into place. This method is causing the right column to act in a way you don't expect. The code above is a simple version of what you're trying to do.
  23. Use a simple if & else statement depending on the cookie/session being set, then echo/print the relevant links.
  24. It'll be down to the margin's you're setting. You've structured the page in a hard-to-follow way. Really what you should be doing is setting 1 containing element, 1 float left + width, 1 float right + width. Something along the lines of this - .wrapper { display: block; width: 1030px; } .wrapper:after { clear: both; content: "."; display: block; height: 1px; visibility: hidden; } .left { display: block; float: left; width: 710px; } .right { display: block; float: right; width: 310px; } <div class="wrapper"> <div class="left">Left content</div> <div class="right">Right content</div> </div>
×
×
  • 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.