Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. PHP Member Pages... Need major help...

PHP Member Pages... Need major help...

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
tutorialphpdatabasemysqlcom
24 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F fly904

    Before you continue, I suggest you tidy up your code and get into some good practices.

    thebiostyle wrote:

    include_once"CONFIGPAGE.php";

    Encapsulate the target file in brackets: include_once('CONFIGPAGE.php');. And use single quotes, as it is quicker.

    thebiostyle wrote:

    $fetch_users_data = mysql_fetch_object(mysql_query("SELECT * FROM `members` WHERE username='".$_REQUEST['username']."'"));
    $fetch_users_id = mysql_fetch_object(mysql_query("SELECT * FROM `members` WHERE id='".$_GET['user']."'"));

    You need to check first whether or not 'user' and 'username' are set. If they aren't then it will throw errors.

    $username = isset( $_REQUEST['username'] ) ? $_REQUEST['username'] : '';
    $user = isset( $_GET['user'] ) ? $_GET['user'] : '';

    You seriously need to sanitise your data inputs to protect from SQL injection attacks. Use the mysql_real_escape_string[^] function.

    $username = mysql_real_escape_string( $username );
    $user = mysql_real_escape_string( $user );

    Then use those sanitized values as your SQL inputs.

    thebiostyle wrote:

    echo "".$fetch_users_data->username."";

    There is no need for the "" around the value. It will work just fine without it: echo $fetch_users_data->username;

    thebiostyle wrote:

    There is no need to have an onload attribute, with $_GET['user']. It is also bad practice to use bgcolor. Use the style attribute instead, or better still use CSS classes.

    thebiostyle wrote:

    </div>
    </table>

    From what I can see you haven't opened a div; therefore there is no need to close one. Note that you should also have a DOCTYPE which you should work from. http://www.w3schools.com/tags/tag_DOCTYPE.asp[^]

    If at first you don't succeed, you're not Chuck Norris.

    L Offline
    L Offline
    Lost User
    wrote on last edited by
    #21

    Okay, everything is fixed, except the color issue... With the DOCTYPE, I think it fixed the colors, but now they're BG=black and FC=red, when they need to be BG=red and FC=black..... BTW, the whole site is filled with errors, but it works for me, lol so it's okay. Though with the site being used for web design and computer graphic design, I will make sure not to include errors in any other page. Thanks!

    L 1 Reply Last reply
    0
    • L Lost User

      Okay, everything is fixed, except the color issue... With the DOCTYPE, I think it fixed the colors, but now they're BG=black and FC=red, when they need to be BG=red and FC=black..... BTW, the whole site is filled with errors, but it works for me, lol so it's okay. Though with the site being used for web design and computer graphic design, I will make sure not to include errors in any other page. Thanks!

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #22

      I still need help with the color issue....

      G 1 Reply Last reply
      0
      • L Lost User

        I still need help with the color issue....

        G Offline
        G Offline
        Graham Breach
        wrote on last edited by
        #23

        I'd really recommend removing all the bgcolor= stuff (and the span, center, b, u tags)and putting it into the style sheet. You can apply multiple classes to an element if you want to, you just need to separate them with spaces, like this:

        <td class="alt dark">some stuff</td>

        Where "dark" is your new class specifying the correct background and font colours:

        td.dark {
        background-color: #FF0000;
        color: #000000;
        font-size: 16pt;
        text-align: center;
        font-weight: bold;
        text-decoration: underline
        }

        If you move all the style information into the style sheet it becomes a lot easier to spot problems in the PHP and HTML.

        L 1 Reply Last reply
        0
        • G Graham Breach

          I'd really recommend removing all the bgcolor= stuff (and the span, center, b, u tags)and putting it into the style sheet. You can apply multiple classes to an element if you want to, you just need to separate them with spaces, like this:

          <td class="alt dark">some stuff</td>

          Where "dark" is your new class specifying the correct background and font colours:

          td.dark {
          background-color: #FF0000;
          color: #000000;
          font-size: 16pt;
          text-align: center;
          font-weight: bold;
          text-decoration: underline
          }

          If you move all the style information into the style sheet it becomes a lot easier to spot problems in the PHP and HTML.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #24

          Thanks for all the help everyone!!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups