
heldenbrau
Members-
Posts
159 -
Joined
-
Last visited
Everything posted by heldenbrau
-
How do you get the encrypted password to send password reminder.
heldenbrau replied to heldenbrau's topic in PHP Coding Help
Is it necessary to use encryption for a user forum password? -
How do you get the encrypted password to send password reminder.
heldenbrau replied to heldenbrau's topic in PHP Coding Help
That is what I did try, but the password in the database is encrypted so I get something like this: &H9&G7g9&er5h3YOgh3hhsbbHBSBBIUgyo instead of the password the password is verified by encrypting the password they enter and matching it to the encrypted password. But this doesn't unencrypt it, so I can't use the same method to get the password to send it to the user. -
It worked ok with the die before the header command. Why does the die need to come after it? I have got it working now, there was a useless echo in there near the start, now I have removed it I get no more header errors yay. Thanks for helping me understand this better.
-
I have read about the whitespace and deleted it, but still got the error. After reading the post at the top I think my problem is lots of lines like this if (empty($_POST['verify'])) { die(header('Location:createid.php?verinone=f')); }else So do I have to put this right at the top $verinone = header('Location:createid.php?verinone=f') and then this later on? if (empty($_POST['verify'])) { die($verinone); }else
-
I have created my website on my windows computer at home and I have moved it over to the web host which is linux. It says apache version 2.2 unix too. Now that I have moved it over, I am getting a load of cannot modify header warnings. I have read on some forums that the error is to do with the character types or something. So what do I need to do?
-
What I mean is $count = mysql_num_rows($result); echo $count see if it says 0
-
Thanks for that. It might be because I used the loopback address for the website on my hardrive.
-
have you tried echoing $result to see if it is 0 and not null or something like that.
-
I want to use php to send a verification email with a link in it. The user clicks the link to verify their account. But when I send the link with html in it, the email is just sent as text and the actual code appears in the email. Also this email goes straight into the spam bin with a phishing warning. Should I be using another method to do this becuase other verification emails from other sites never go into the spam bin.
-
I have just signed up to a web host that say they support PHP. But now that I have uploaded my site, I don't know what to do. Am I supposed to upload appache and php to my ftp site? All I can do in the control panel of the hosting company is add extensions to apache with their interface and add mime extenstions. But I can't add the bit that points apache to PHP, so when you visit my website it asks to download the file
-
I have shtml files that also include PHP and PHP files that have includes. I need both files to be read by the server. The hosting company I am with doesn't let you alter the file, but lets you add mime types and apache handlers with a control panel. What do I need to add?
-
Another thing. If I have divs floated to the left and a div floated to the right. If I put text on the next line after the divs floated left, it comes out in the space between the last div and the right div in IE. It comes out on the next line in Firefox. So If I use <br> to get it to the next line, it makes a massive gap in firefox. Even if I put the text into another div, it still doesn't go onto the next line in IE.
-
I am just learning CSS and have decided to do my next site with CSS. I am testing the site first with IE and Firefox and have had to switch back to using tables instead of DIV's on one of my pages. The reason is: If I have a 78% Div within a Div, Firefox renders the Div as being 78% of the page, but IE renders the DIV as being 78% of the Div that it is in. So it will either be too long in one or too short in the other. But both render tables the same way, that's why I have switched to tables. Is there something I am missing with using Div and float? If the 2 different browsers render them differently, which they have been with me, then the page ends up looking a right mess.
-
It says NULL. I have been working on this problem all night and have found a solution, but I don't understand fuly what is going on. If I close $mysql after each query and then start a new $mysql and log in again, then it works, even though it is the same database I am using. Do I have to do this every time I want to start a new query?
-
$mysqli = new mysqli("localhost", "username", "password", "user"); if ($mysqli === false) { die("ERROR: Could not connect to database. " . mysqli_connect_error()); } $defun=$mysqli->escape_string($defendant); $sql="SELECT email FROM users WHERE username='$defun'"; if ($result = $msyqli->query($sql)) { $row = $result->fetch_assoc(); $mail = $row['email']; }else{ die("No user could be found with that username"); } I always get info from the database with this method. But in this one bit of the program on one php file, I get the error: Fatal error: Call to a member function query() on a non-object The line it has a problem with is if ($result = $msyqli->query($sql)) { What does the error actually mean, and what would cause it to happen?
-
This is on the first line of php in a webpage, which is line 30 <?php $case = $_GET[case]; It is to pick up the value 76 from another page <a href="agree.php?case=76> I keep getting the following error. But I use the same code in another program and it is fine with that. Parse error: syntax error, unexpected T_CASE, expecting ']'
-
Characters that need to be escaped when using "" or ''
heldenbrau replied to heldenbrau's topic in PHP Coding Help
I need some of the variables to be passed, so need double quotes. I have downloaded a script editor now that has solved my problems. I downloaded tsWebEditor and it put all the text in between " and " in red, and the \bits in blue. It immediately showed me where the problem was: </a> | Posted \$postime BST\\n\ "; I thought it had just wrapped around to the next line, but it really looked like this //n/ "; a space between the / and the " so the " wasn't slashed out. I don't think I would ever had found this. Looks like I need this script editor, it will save me hours. -
Characters that need to be escaped when using "" or ''
heldenbrau replied to heldenbrau's topic in PHP Coding Help
The line number with the error is always the same, even if I delete or add blank or non blank lines. -
Characters that need to be escaped when using "" or ''
heldenbrau replied to heldenbrau's topic in PHP Coding Help
I don't think there is anything wrong with that line because it is just a blank line. I think the problem is caused before it. I will post some lines of the data string and point out where that line 402 is. \$sql=\"SELECT userid, rating, text, time FROM casedet$casenum ORDER BY time ASC \$max\"; if (\$result = \$mysqli->query(\$sql)) { if (\$result->num_rows > 0) { while(\$row = \$result->fetch_array()) { \$postime= date(\"d M Y H:i:s\", \$row[3]); echo\"<div id=\\\"userid\\\">\ n\"; echo\"<a href=\\\"userids/\$row[0].php\\\" target=\\\"_blank\\\">\$row[0] (\$row[1])</a> | <a href=\\\"report.shtml\\\" target=\\\"_blank\\\">(Report this post) </a> | Posted \$postime BST\\n\ "; echo\"</div> \\n\"; echo\"<div id=\\\"casecontent\\\">\\n\ "; echo\"<br />\\\n\"; echo\"\$row[2]<br /> <br />\ \n\"; echo\"</b></b></u></i></a></font>\\n\"; echo\"</div>\\n\"; } \$result->close(); } }else { echo \"ERROR: Could not execute \$sql . \" . \$mysqli->error; } \$mysqli->close(); echo \" --Page \$pagenum of \$last-- <p>\"; if(\$pagenum >4 and \$pagenum<(\$last-3)){\$next1 = \$pagenum-3; }else if (\$pagenum <5) {\$next1=2; }else if (\$pagenum >(\$last-4) and \$last>9) {\$next1 = \$last-7; }else{\$next1=2; } echo \" --Page \$pagenum of \$last-- <p>\"; <---- This is line 402, a blank space if(\$pagenum >4 and \$pagenum<(\$last-3)){\$next1 = \$pagenum-3; }else if (\$pagenum <5) {\$next1=2; -
Characters that need to be escaped when using "" or ''
heldenbrau replied to heldenbrau's topic in PHP Coding Help
But aren't there any other characters I need to escape. I want to get php to create another php program, it is huge so I couldn't expect anybody to go through the whole thing for me. I am quoting the whole program in " and " so am escaping the characters " and $ with \" and \$ But how do I know that I am escaping all the characters I need to, what about characters like ? + ; I need to know all the characters that need the slash in front of them. At the moment I have this error Parse error: syntax error, unexpected '"', expecting T_STRING in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\kangercourt\website\post.php on line 402 I have been going over the enquoted program of 7 hours now and I cannot find where I have gone wrong. I must have checked that every $ and " has a slash in front of it 100 times, and they all do. I am losing hope. -
I have been trying to find on the internet a simple list of characters that need to be escaped. I want to know what characters need to be escaped when using " " and what ones need to be escaped when using ' ' I can't find this information anywhere, so I don't know what is causing the bugs in my code.
-
Is now working, I forgot to restart Apache, thanks for the help.