Jump to content

Twister1004

Members
  • Posts

    201
  • Joined

  • Last visited

Posts posted by Twister1004

  1. @Maq

    ------

    When I go to cp.php (Clicking the link) I am getting a undefined Index in the URL. So that means I did it 50%, In a way.

     

    @Altec

    -------

    I have no idea what what you used in your code. I could guess, but Id rather figure out the $_Get first for the URL =P.

     

    @lodius

    -------

    I used, it and it just came out as an Error. But I believe Maq fixed it.

     

     

    Cerious, do any of you have TeamViewer to make this easier?

  2. I'm getting it now! However, When i try to link it to another page, it isnt executing correctly.

     

    How would i be able to use it inside a link? could i have to do this?

    <div style = "position:absolute; left:501px; top:-4px;">
    <a href = <?php echo " "cp.php?user='.$username.'" "; ?> >profile</a>
    </div>

     

    OR some other way?

  3. @Crayon

    ---------

    Honestly, I had no idea what you were trying to tell me. I didn't understand how to use it. Thanks though.

     

    @prexep

    --------

    That kinda helped in a way. Thanks

     

    @lodious

    --------

    This made a WHOLE lot more since. I'm going to try and see if I understand it now. Be back in like 5 minutes =)

  4. Hey everyone, I'm needing to understand how to use a $_GET action. When ever i use it it doesnt work, or tells me there is an undefined variable. I do not need forms for get, but perhaps a way to call it from somewhere else.

  5. I had someone do my Login data and stuff. But before you can even do anything with it, the first thing i learned is you are going to need to have a database and know how to use SQL, PHP, and MySQL. Another thing is you need to use this

    <?php session_start(); ?> 

    This will allow all sessions to start and work. Then You need to write out a script with using sessions, cookies or what ever.

     

    You will need to recall things in your database and within the script as well.

     

    I hope something made since and you understood :P

  6. This is how my profile is setup right now. The header.php has all the Sessions and login information within it. However, I can't seem to get the $_GET working correctly. I'm getting notices or errors. He is my Profile page:

    Now with that all said, how would i be able to call a $_GET since It doesnt like me, lol.

     

    <?php session_start(); ?>
    <?php error_reporting(E_ALL);?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link href="style.css" rel="stylesheet" type="text/css" />
    <style>
    body,td,th {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #FFFFFF;
    }
    body {
    background-color: #000000;
    background-image: url(images/bg-soft.PNG);
    background-repeat: repeat;
    }
    #loggedin_info {
    position:absolute;
    left:159px;
    top:100px;
    width:218px;
    height:400px;
    z-index:1;
    margin:auto;
    padding:0px;
    }
    #header{
    position:absolute;
    background:#000000;
    top:2px;
    left:100px;
    }
    #notloggedin{
    position:absolute;
    left: 405px;
    top: 198px;
    width: 444px;
    height: 32px;
    }
    #content_loggedin{
    position:absolute;
    top:99px;
    left:381px;
    width: 528px;
    height: 399px;
    }
    #side_rename{
    position:absolute;
    top:99px;
    left:920px;
    width: 189px;
    height: 401px;
    }
    #nav{
    position:absolute;
    left:4px;
    top:102px;
    width:145px;
    height:388px;
    color:white;
    background:#4682B4;
    }
    #button_account{
    position:absolute;
    top:473px;
    left:209px;
    width: 150px;
    }
    #content_account{
    position:absolute;
    top:472px;
    left:586px;
    }
    #unknown_account{
    position:absolute;
    top:474px;
    left:955px;
    }
    </style>
    </head>
    
    <body>
    <div id = login>
    <?php
    include('header.php');
    $result = mysql_query("SELECT about,content,unknown FROM `profile` WHERE `accountid` = {$_SESSION['login_id']}");
    if (!$result) {
        echo 'Could not run query: ' . mysql_error();
        exit();
    }
    $row = mysql_fetch_row($result);
    ?>
    </div>
    <?php if (isset($_SESSION['login_user'])){ ?>
    <div id="loggedin_info">
    <p align = center>
    <br/><br/>
    About me, <br/><?php echo htmlentities($row[0]); ?></p>
    </div>
    <div id = content_loggedin>
      <p align = center>About your self,<br/> <?php echo htmlentities($row[1]); ?></p>
    </div>
    <div id = side_rename>
      <p align = center>Personal Use <br/><?php echo htmlentities($row[2]); ?></p>
    </div>
    <?php
    }
    else{
    ?>
      <div id = notloggedin>
        <center>
    <strong>You must be loggedin to view your profile!</strong><br/> The profiles is currently, not done, or functional. Please wait while we get this online, ASAP!<br/> Thank you!</center></div>
    <?php } ?>
    <div id = nav>
    <center>
    <hr />
    <a href = "./index.php">Home</a><br/><hr />
    <a href = "./faq.php">FAQ</a><br/><hr />
    <a href = "./about.php">About Us</a><br/><hr />
    <a href = "./index.php">Projects</a><br/><hr />
    </center>
    </div>
    </body>
    </html>
    

     

    I know this is a double post, but i can't edit O_o.

  7. I now understand it somewhat better now! But my only problem is I just can't seem to get it to call correctly. I'm getting notices (I'm using error_reporting(E_ALL) ). saying there is no index for it. (Yes i changed inside the  "[]")

  8. OMg, i did something on accident and i got the $_GET command to work! However it was an accident. It was in a form.

     

    So, now i figured that out, can i just tell it to $_GET the variables anywhere? Or does it have to be in just once place?

  9. I have a profile page named cp.php.

     

    Do i need to post the $_GET at the top of the page before it loads?

    (I honestly think there is no help for me, lol)

     

    ugh, Ill see what I can but I dont know how you would take someone out the the URL o.o

  10. Ok, so basically how i set up the webpage for the profiles, i have a pages that is speciflly for the login details and variables. So, umm.... I guess the main part i was confused about, is how would i be able to just get a specific profile without having to put a page just to get on the person's profile?

     

    Maybe I'm just confusing myself.

     

    I understand the $_GET now. Ummmm, god i'm just confused about how to get to their profiles without giving a page with all the users and linking it to there. ._. Could you possiably explain that? I believe once I understand that, the rest will just fit in.

     

    Until then, I will go play with the codes! (God help me, lol)

  11. Ok, so say like i didn't make a userlist page.

     

    Ummm, let me see if i can get this...

     

    <?php
    //Mysql is connected
    $id = (int) $_GET['id']; //the ID is a interger. This is what i dont get. where will it get the ID from?
    if (!($id > 0)) {//if the ID is above 0 (Or 1 meaning the profile exists)
        $id = $_SESSION['user_id']; //display their own profile if they decide to mess with the query string too much 
    //what? how would they do that? lol
    }
    $query = "SELECT * FROM users WHERE id=$id";//selects the ID of the user from the database from $id
    $result = mysql_query($query) or die(mysql_error()); //Goes to result as a query or it dies if not successful.
    //code of the profile is setup by arrays and SQL

  12. I get the idea, its just not making since to me right now. If you saw how i did my Geometry work, you would see how and why, lol. I showed everyone how i did it they were like "Omg dont show me that! Wth is that!" So, yeah lol.

     

    Grr, I really hate asking this, just because so many people have asked me and stuff, But would you mind if i add you to MSN? It would probably help me more and faster if it was an IM.

     

  13. Ok, but how about being able to just type in the user's ID into the link as well? Would that be possible, or would you have to just let the script run while you click on the profile?

     

    My next question is, would it just be easier to have everyone's name then link the name to their page?

  14. Hey everyone! I am creating a new thing on my webpage to where I have made a profile page! Now what I'm trying to do is,

     

    Objective: Allow Logged in people to view other people's profile.

     

    However, I don't know how i would go about that. As you can tell in my sig, I'm not a very advanced coder. I'm basically newborn. Could someone explain to me and also help me with this? O_o.

     

    I've all ways like to progress in what I do, and this to me seems like a good goal =D.

     

    If any code is needed at all, I will provide it.

     

    Any hints or tips is accepted =D

  15. The reason why, is because your setting to to a variable. so say we used $updatewhat as paper and $updateto as ink and $where as blood.

     

    This is what your statement would do:

    $result = mysql_query("UPDATE monsters SET $updatewhat="ink" WHERE $updatewhat="blood" ")

     

    You never told SQL to define the variables.

    Try this (Note i did not test this.)

     

    $result = mysql_query("UPDATE monsters SET '$updatewhat' = '$updateto' WHERE '$updatewhat' = '$where'")
    or die(mysql_error());
    

    However, I still think the SET $updatewhat should be defined and not a variable. True you might have to add in more code, but it would be less confusing and easier to change.

  16. Hey guys, I really like this forum, seems like it will be a lot of help to me, as a new coder.

     

    However, I am getting an error within my script. Before I show you the script, I would like to tell you what I am trying to do.

     

    Objective: I am trying to get the person registered as like a normal script, however, as well when they register, I am making a profile page for them as well. (Still coding it so it's not working.) So what I am trying to do is get the person registered, then get the information just entered to go into another table along with their account id.

     

    My problem: While I do this, I am getting an "Incorrect integer value: '' for column 'accountid' at row 1"

    accountid is a column within the table accounts. There is also another spot in the table profile for accountid as well.

     

    Conclusion: So basically this should make more since. I'm trying to take the accountid from the account newly created row from the table accounts to the table profile.

     

    Script:

    <?php error_reporting(E_ALL);?>
    <html>
    <head>
    <title>Abysmal Essence | Register - Complete</title>
    </head>
    <body>
    <?php
    
    $user = $_POST['user'];
    $name = $_POST['name'];
    $pass = $_POST['pass'];
    $vpass = $_POST['vpass'];
    $email = $_POST['email'];
    $dob = $_POST['dob'];
    
    
    include ("config.php");
    
    $sel = 'SELECT * FROM `accounts` WHERE `username`="' . $_POST['user'] . '"';
    
    //Andy edited here
    $result = mysql_query($sel) or die(mysql_error());
    $data = mysql_fetch_assoc($result);
    
    if(mysql_num_rows($result) >0)
    {
    //echo "Username exitsts<br>";
    }else{
    //echo "Username Aviable<br>";
    }
    
    
    
    
    if ($user == "")
    {
    echo 'Please enter a username.';
    exit();
    }
    elseif (mysql_num_rows(mysql_query($sel)) >= 1)
    {
    echo 'The username already exists. Please choose another name.<br>';
    exit();
    }
    elseif ($pass == "")
    {
    echo 'You did not enter a password. Please go back and enter a password.<br>';
    exit();
    }
    elseif ($vpass != $pass)
    {
    echo 'Your passwords do not match. Please re-enter your password.<br>';
    exit();
    }
    else
    {
    $con = 'INSERT INTO `accounts` (username, name, password, email, dob) VALUES ("' .
    	$user . '", "' . $name . '", "' . $pass . '", "' . $email . '", "' . $dob . '")';
    $accountid = mysql_query($account['accountid']);
    $account = "SELECT * FROM `accounts` WHERE `accountid` = '$accountid'";
    $con2 = 'INSERT INTO `profile` (accountid, about, content, unknown) VALUES ( "'.$accountid.'","Edit me", "Edit me", "Edit me")';
    mysql_query($con2) or die(mysql_error());
    mysql_query($con) or die(mysql_error());
    echo '<center>You have successfully created your account. You can now log in.</center>';
    }
    ?>
    <br/><br/>		Your account has been created.<br/> You will be e-mailed on your Login information. Please note: We have to manually send E-mails.<br/>If you are within the team for development, you will be sent an extra ID along with your login information.<br/> More info will be told when E-mails are received.<br/>
    
    <input type='button' value='Home' onclick='parent.window.location.href = "./"' />
    </body>
    </html>
    

     

    Now the script I added into this would be this section:

    else
    {
    $con = 'INSERT INTO `accounts` (username, name, password, email, dob) VALUES ("' .
    	$user . '", "' . $name . '", "' . $pass . '", "' . $email . '", "' . $dob . '")';
    $accountid = mysql_query($account['accountid']);
    $account = "SELECT * FROM `accounts` WHERE `accountid` = '$accountid'";
    $con2 = 'INSERT INTO `profile` (accountid, about, content, unknown) VALUES ( "'.$accountid.'","Edit me", "Edit me", "Edit me")';
    mysql_query($con2) or die(mysql_error());
    mysql_query($con) or die(mysql_error());
    echo '<center>You have successfully created your account. You can now log in.</center>';
    }

     

    Any advice or help?

     

    Thank you very much for reading / posting.

×
×
  • 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.