
Shadowing
Members-
Posts
722 -
Joined
-
Last visited
Everything posted by Shadowing
-
Proper way of using OR with two if commands
Shadowing replied to Shadowing's topic in PHP Coding Help
k i changed it to isset. just curious why you say it is beter cause ive been using empty alot maybe i should stop still getting a error on mysql_query("DELETE FROM `users` WHERE `id`= ".(int)($_SESSION['user_id']); Parse error: syntax error, unexpected ';' in C:\Software\XAMPP\xampp\htdocs\stargate\delete_account.php on line 70 if (isset($_POST['escape'])) { if(!isset($_POST['agree'])){ echo "You need to check the box"; } else { mysql_query("DELETE FROM `users` WHERE `id`= ".(int)($_SESSION['user_id']); } } -
Proper way of using OR with two if commands
Shadowing replied to Shadowing's topic in PHP Coding Help
oh i guess it needs to read more like this. I took out the or for testing reasons this still doesnt work though hmm if (isset($_POST['escape'])) { if(empty($_POST['agree'])){ echo "You need to check the box"; } else { mysql_query("DELETE FROM users WHERE id='".mysql_real_escape_string($_SESSION['user_id']))."'"; } } -
Proper way of using OR with two if commands
Shadowing replied to Shadowing's topic in PHP Coding Help
Forgot to say thanks for reading my post and helping me guys I get a error with using your code on mysql_query("DELETE FROM `users` WHERE `id`= ".(int)($_SESSION['user_id']); im trying to get it to read saying if one of the two buttons are clicked and agree isnt empty then account will get deleted where the id matches the id session. thats a good point you made haha i need to change it to if(!empty($_POST['agree'])){ -
Proper way of using OR with two if commands
Shadowing replied to Shadowing's topic in PHP Coding Help
its a check box they have to check before the next else happends why cant i have two else blocks like that? -
Proper way of using OR with two if commands
Shadowing replied to Shadowing's topic in PHP Coding Help
I'm trying to let people delete their account but its not working if (isset($_POST['escape']) || (isset($_POST['suicide']))) { }else{ if(empty($_POST['agree'])){ echo "You need to check the box"; }else{ mysql_query("DELETE FROM users WHERE id='".mysql_real_escape_string($_SESSION['user_id']))."'"; } } -
Proper way of using OR with two if commands
Shadowing replied to Shadowing's topic in PHP Coding Help
maybe its suppose to be more closer to something like this if (isset($_POST['escape']) || (isset($_POST['suicide'])) { Edit: nevermind i got it to work forgot to add the other ) so its (isset($_POST['escape']) || (isset($_POST['suicide']))) { -
Im having trouble with this wondering if someone could help me out please if (isset($_POST['escape'])) { || if (isset($_POST['suicide'])) { its giving me a error on the || im writing it so that one or the other has to happend. is this the correct way to use this?
-
idk I read a ton of online tutors, its way over my head. i think i'll just store the password for now then when my site goes live come up with a lock out a attacker cant see my passwords unless they gain admin access right?
-
oh so i shouldnt md5 and replace their password with the generated one until they click on the link with the token i didnt even realize thats how those links worked. didnt you know you could store data in a link and not be part of the dir of the link that would be easier to do I think i can write the script to do it where the random password is emailed to them and then they use that to log in and it replaces and their current password. but creating a link like that with the token i'll have to find a tutor online helping with that
-
alright i figured out how to echo it Now i need to figure out how to generate it and store, mail it then md5 it into my data base. Im guessing the best way to do this is to generate and save to a Session? then use that to do everything else
-
There is so much to PHP lol ive just scratch the surface on how to use functions how do I echo this correctly or better yet how do I store the password from it so i can email it wanted to echo it first to make sure it works sorry im really trying to learn this if someone could help me out. I finally got the hang of writing strings on my own though <?php function rand_passwd( $length = 8, $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' ) { return substr( str_shuffle( $chars ), 0, $length ); } echo "The password is ";rand_passwd(); ?> I'll check your article out xyph. I spent a while getting my script to mail my password out then i realize i couldnt get rid of the MD5 haha
-
Since I cant undo the MD5 is it safe to say record their password again with out MD5 in the data base and use that to mail them their password if they forgot it?
-
lol thanks guys. I got it all working.
-
I cant figure out what is wrong with this hopefully someone can help me out would appreciate it if($_POST['resendemail']) != $send1['mail'] { echo "This email doesnt exist."; Parse error: syntax error, unexpected T_IS_NOT_EQUAL in C:\Software\XAMPP\xampp\htdocs\stargate\login.php on line 78 if I delete the ! then it says something is wrong with = am I missing something? if I do this it stops the error but doesnt look right to me if($_POST['resendemail'] != $send1['mail']) {
-
Need help with using Mecury locally
Shadowing replied to Shadowing's topic in Other Web Server Software
Nevermind I got it working -
Insert into table if id matches session id
Shadowing replied to Shadowing's topic in PHP Coding Help
thanks alot for the help xyph -
Insert into table if id matches session id
Shadowing replied to Shadowing's topic in PHP Coding Help
I must have something wrong its giving me a error Edit: nevermind i fixed the error -
Insert into table if id matches session id
Shadowing replied to Shadowing's topic in PHP Coding Help
thanks for the reply xyph huge help do I need to sanitize it twice like this? $sql = "UPDATE 'users' SET 'goauld' = '".mysql_real_escape_string($_POST['goauld'])."' WHERE 'id' = '".mysql_real_escape_string($_SESSION['user_id'])."'"; how do I seperate this code so its on seperate lines? also is there a reason why this code below doesnt use ' ' around users $results = mysql_query("UPDATE users SET userip='".mysql_real_escape_string($_SERVER['REMOTE_ADDR'])."',login_ip='".mysql_real_escape_string($roe['login_ip'])."' WHERE id='".mysql_real_escape_string($_SESSION['user_id'])."'") -
Im trying to insert a name into my database but I need it to go into the column that matches the sessions user id "INSERT INTO users SET name = '".$_POST['name']."'"; how do I tell it to put name into name column with id matching Session id. really appreicate if someone could please help me with this.
-
The support forum for mecury isnt very active. Trying to set up it up for local use only. The server appears to be working correctly it recieved the mail. The problems seems to be outlook express trying to connect to mercury I follow this online set up tutor http://system66.blogspot.com/2010/01/how-to-send-mail-from-localhost-with.html Server settings MercuryS SMTP server 127.0.0.1 port 25 MercuryP POP3 server 127.0.0.1 port 110 MercuryE 127.0.0.1 then created a account on MercuryD Host 127.0.0:110 on core module configuration I have 127.0.0.1 for interent name for this system then i created a user account for shadowing Outlook express 127.0.0.1 for account name user information shadowing [email protected] SMTP 127.0.0.1 25 Pop3 127.0.0.1 port 110 account name shadowing if anyone could help with me id appreciate it
-
oh yah i forgot i should destroy the session there too. Thanks. to day has been quite the day haha I found out the larger problem I was having. What was really cuasing my problems was a if statement i had before all that code.
-
is there some sort of way to place something on a page so that when I have a echo i can make it display there? php can get things from forms can it place text somewhere? if so what references should I be reading to do it. was hoping there was a way to make a box and have it display inside a box to where i put the box on the webpage
-
I got it all working now. log out and auto log out <?php include_once("connect.php"); session_start(); if (!(isset($_SESSION['login_time']) && $_SESSION['login_time'] != '')) { header ("Location: signup.php"); exit(); } else { if ($_SESSION['login_time'] < strtotime('now - 60 minutes')) { // logs user out after 15 minutes and redirects to login and ends session header("Location: signup.php"); exit(); } } ?>
-
I got it working on my own woot !!! <?php include_once("connect.php"); session_start(); if (!(isset($_SESSION['login_time']) && $_SESSION['login_time'] != '')) { header ("Location: signup.php"); exit(); } else { if ($_SESSION['login_time'] < strtotime('now - 60 minutes')) { // logs user out after 15 minutes and redirects to login and ends session header("Location: signup.php"); exit(); } } ?>
-
ok i got rid of the auto log out and got the log out to work. using destroy session on log out and <?php include_once("connect.php"); session_start(); if (!(isset($_SESSION['login_time']) && $_SESSION['login_time'] != '')) { header ("Location: login.php"); } ?> i wanted a auto log out though I think