Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New Coder
    Join Date
    Jul 2007
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Quick and easy PHP questions.

    Okay, I'm fairly ignorant with php and mySQL, and I apologize. Here's what I don't understand.

    http://www.evolt.org/PHP-Login-Syste...Admin-Features

    I'm using that, and it says "hey, just cut and paste/mod this and you are good". I have the tables made in my database, but I don't know where to put the .php files and what I need to do.

    I am done with the first section of code, and I am stuck on the second. Any suggestions?

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    It also says it's for intermediate to advanced PHPers, which explains they brevity of the documentation.

    You do have a web server up and running, yes? Apologies if that seems like a stupid question, but some think that only code is enough.

    The easiest situation would be that all you do is drop all the files in your web root. However, I glanced through and found at least one file that includes one of the others from a subdirectory (include "includes/whatever.php"). You ought to be able to determine what the implied directory structure is by looking at those includes. Any of the format include "filename.php" should all be in the same directory. Any with paths, create appropriately.

  • #3
    New Coder
    Join Date
    Jul 2007
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a server, a host, and a mySQL server. I downloaded the entire tutorial and I came pre-ordered in folders including "includes", "variables", etc. Can I assume it is in order? If so, I'll just log into my server via FTP, and drop everything to the main part, no dropping in public_html, private_html, www, right?

  • #4
    Regular Coder
    Join Date
    Sep 2007
    Location
    Grahamstown, South Africa
    Posts
    237
    Thanks
    6
    Thanked 17 Times in 17 Posts
    Goodness me, I see where your problem lies. Sometimes the method of setting up a website is what a lot of people struggle with.

    It's really difficult to explain procedure as opposed to explaining snippets of code. I suggest you take a deep breathe, backup your website and start experimenting.

    Normally you would upload the module to the public_html folder on your webserver.

    Good luck.

  • #5
    New Coder
    Join Date
    Jul 2007
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Take a look at my site now. I inserted the PHP scripts as they were grouped in the public_html folder. I tried to insert the <? include "sessions.php" ?> into my HTML, but it would not stay. Every time, for some reason it "disappears". Any ideas? I'm only taking the code from one of the PHP files that says "this is the main table to use" and inserting the <? ___ ?> and <table>___</table>

  • #6
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    If by "disappears" you mean you can't see it with a View Source, that's expected. Happens with all php unless the web server is broken. That's the effect of the browser implementing the php script in building the page.

  • #7
    New Coder
    Join Date
    Jul 2007
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
        <table>
          <tbody>
            <tr>
              <td><?php IF($LOGGEDIN==TRUE)
    echo "
    <h?>Logged
    In
    ";
    echo "Welcome <b>$session-&gt;username</b>, you are
    logged in. <br />
              <br />
    "
    ."[<a href="%5C%22userinfo.php?user=$session-">username\"&gt;My
    Account</a>] &nbsp;&nbsp;"
    ."[<a href="%5C%22useredit.php%5C%22">Edit Account</a>]
    &nbsp;&nbsp;";
    if($session-&gt;isAdmin()){
    echo "[<a href="%5C%22admin/admin.php%5C%22">Admin Center</a>]
    &nbsp;&nbsp;";
    }
    echo "[<a href="%5C%22process.php%5C%22">Logout</a>]";
    }
    else{
    ?&gt;
              <h1>Login</h1>
    num_errors &gt; 0){
    echo "<font color="\&quot;#ff0000\&quot;" size="2">".$form-&gt;num_errors."
    error(s) found</font>";
    }
    ?&gt;
              <form action="process.php" method="post">
                <table align="left" border="0"
     cellpadding="3" cellspacing="0">
                  <tbody>
                    <tr>
                      <td>Username:</td>
                      <td><input name="user" maxlength="30"
     value="&lt;? echo $form-&gt;value(" user="" )="" ?=""
     type="text" />"&gt;</td>
                      <td>error("user"); ?&gt;</td>
                    </tr>
                    <tr>
                      <td>Password:</td>
                      <td><input name="pass" maxlength="30"
     value="&lt;? echo $form-&gt;value(" pass="" )="" ?=""
     type="password" />"&gt;</td>
                      <td>error("pass"); ?&gt;</td>
                    </tr>
                    <tr>
                      <td colspan="2" align="left"><input
     name="remember" type="checkbox" />value("remember")
    != ""){ echo "checked"; } ?&gt;&gt; <font size="2">Remember
    me next time &nbsp;&nbsp;&nbsp;&nbsp; <input
     name="sublogin" value="1" type="hidden" /> <input
     value="Login" type="submit" /></font></td>
                    </tr>
                    <tr>
                      <td colspan="2" align="left"><br />
                      <font size="2">[<a
     href="forgotpass.php">Forgot Password?</a>]</font></td>
                      <td align="right"></td>
                    </tr>
                    <tr>
                      <td colspan="2" align="left"><br />
    Not registered? <a href="register.php">Sign-Up!</a></td>
                    </tr>
                  </tbody>
                </table>
              </form>
    ?&gt; </td>
            </tr>
            <tr>
              <td align="\&quot;center\&quot;"><br />
              <br />
    ";
    echo "<b>Member Total:</b>
    ".$database-&gt;getNumMembers()."<br />
    ";
    echo "There are $database-&gt;num_active_users registered members
    and ";
    echo "$database-&gt;num_active_guests guests viewing the site.<br />
              <br />
    ";
    include("include/view_active.php");
    ?&gt; </td>
            </tr>
          </tbody>
        </table>
    I can't figure it out. I've looked at it over and over again, and I'm not sure what the problem is.

  • #8
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Something is screwy with your editor maybe. All those &gt; should be actual greater than signs.

    Just curious: do you happen to be using Dreamweaver? And do you happen to type your PHP code into the HTML viewport (as opposed to the text/source viewport)?

  • #9
    New Coder
    Join Date
    Jul 2007
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm actually using Nvu, and it must have transferred it over somewhere. IDK, thanks though, I'm going to try that now!

  • #10
    New Coder
    Join Date
    Jul 2007
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay...I'm about to sell a kidney and buy an asian to do this for me.

    Okay, every time I input the table, it says nothing exists.

    Could someone please, PLEASE look at the tutorial from the top, download the files at the end of the tut, and look through them quickly? I am using the main.php document, and it says "hey, put this in your HTML and your site will magically work" and NOTHING! I put all the files as they were downloaded, only out of the "login/login" folders, and uploaded them to my public_html folder.

  • #11
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Since that's an entire project including db setup, you probably won't get many takers for doing your testing. Error messages would be helpful for tracking down problems. Showing a section of code where you know there's a problem is good. It's pretty easy to get some quick help when there's something to work with.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •