Jump to content

neex1233

Members
  • Posts

    73
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

neex1233's Achievements

Member

Member (2/5)

0

Reputation

  1. How do I get the current logged in username or id using the Twitter API?
  2. I've been looking for a way to do this for a long time. I have a simple(ish) login system, and I want to allow users to login with Twitter or Facebook; How can I do this? I'm pretty experienced at PHP and MySQL, but I really don't understand the API of either of the social networking sites. If you only know how the API for one of the sites, that'd be great too.
  3. I fixed it. It was because I was using a URL include (for testing).
  4. I'm trying to include a file that contains code checking if a user is logged in, and if they are not it redirects them to the login form. The only problem is I don't think the script can check if the user is logged in if it is included. The funny thing is, I include the same exact script on the index of my site and it works fine, but when I incude it in a subdirectory file, it takes me to the login form. How can I fix this?
  5. Thank you guys so much! (I'm a n00b)
  6. It's not the actual making of the cookie that's the problem, it's the detection of the cookie. The cookie is made fine, I've checked in Add 'n Edit Cookies, but this code: <?php ob_start(); ob_clean(); $user = $_COOKIE['username']; if(isset($user)) { } else { header("location: /users/login.php"); } ?> isn't working. The code works on other pages, though.
  7. <?php /* $con make a connection with database */ $con=mysql_connect("localhost","root",""); //select database mysql_select_db("users"); /* Below two commands will store the data in variables came from form input */ $username=$_POST['user']; $password=$_POST['pass']; /* below two commands are sql injection which stops extra characters as input */ $user=mysql_real_escape_string($username); $pass=mysql_real_escape_string($password); $query=mysql_query("SELECT * FROM users where user='$user' AND pass='$pass' "); $count=mysql_num_rows($query); if($count==1) /* $count checks if username and password are in same row */ { echo "Login Successful"; $hour = 86400*365; /* $hour sets cookie storage time for 1 hour */ /* setcookie() function sets cookie after login */ ob_start(); ob_clean(); setcookie("username", $_POST['user']); setcookie("password", $_POST['pass']); header("location:/"); /* header() funtion redirect user to members page */ } else { echo "Username or password is incorrect"; } ?> And <?php ob_start(); ob_clean(); $user = $_COOKIE['username']; if(isset($user)) { } else { header("location: /users/login.php"); } ?> I know the cookies exist, because I looked in Add 'n Edit Cookies.
  8. It's not before any tags, and those tags aren't helping. I tried putting var_dump($_COOKIE); on the page I'm having the problem, and it doesn't do anything. However, if I do it on a different page, it works.
  9. This has been driving me crazy for hours! I am trying to set a cookie: setcookie("username", $_POST['user']); And for a while it wasn't working, then it started randomly working. Now, when I try to use if(isset($_COOKIE['username'])) PHP is saying the cookie does not exist. PLEASE help! Thanks.
  10. Btw, here's the errors: Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\Codes\lyt.php on line 14 Warning: include(http://domain.com/codes/css/ff.php) [function.include]: failed to open stream: no suitable wrapper could be found in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\Codes\lyt.php on line 14 Warning: include() [function.include]: Failed opening 'http://domain.com/codes/css/ff.php' for inclusion (include_path='.;C:\php5\pear') in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\Codes\lyt.php on line 14
  11. I'm trying to enable URL includes (allow_url_include), and I put "On" in the php.ini file, but it doesn't work. In the phpinfo() file, it also says they are off. Could somebody please help me?? Thanks.
  12. Thanks... Here is the send page <?php include("directory/lyt.php"); ?> <form action="send.php" method="post"> To:<br> <input type="text" name="to" size="7"/><br /> Subject:<br> <input type="text" name="subject" maxlength="20" size="18" /><br /> Message:<br> <textarea rows="4" cols="35" name="message" onFocus="this.value=''">Hi!</textarea><br> <input type="submit" value="Send!" /> </form> <br><br> <a href="URL"><small>« Back to Inbox</small></a>
  13. I have a PHP message script, and when I try to send a message (this just started happening today, all was fine before) it takes it to the delete form. On the send form page, there is a PHP include, which is the layout, and when the layout file is included the send button takes you to the delete form, but when the layout is not on the page, it takes you to the normal send page and works perfectly! Can anyone help me with this? It has never happened to me before!
  14. Hi, I want to echo a string in PHP, then erase it from the screen, but I can't find any way to do so. Is there a function or something? Thanks.
×
×
  • 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.