Northern Flame
-
Posts
816 -
Joined
-
Last visited
Never
Posts posted by Northern Flame
-
-
i dont really understand what you are trying to do,
you have a select tag, and depending on the results
of what the user selects you want to echo either an
input where the user puts more info or a read only
input tag with pre-written info? is that what you are
trying to do?
-
you were telling the script to echo the error if the user submitted a value,
that was your problem.... try this:
<CENTER> <form action="index.php?body=register" method="post" class="black"> Username: <input type="text" name="username"/> Password: <input type="password" name="password"/> Confirm passowrd: <input type="password" name="password2"/> Email: <input type="text" name="mail"/> <input align=center type="submit" value="Register!"/> <?php $t_user=$_POST['username']; $t_pass=$_POST['password']; $t_pass2=$_POST['password2']; $t_mail=$_POST['mail']; if (empty($_POST['username']) or empty($_POST['password']) or empty($_POST['password2']) or empty($_POST['mail'])) { echo "<div class='border_red padding_mid back_red'>"; if ($t_user=='') echo "You left the username field blank."; else if ($t_pass!=$t_pass2) echo "The passwords you typed did not match. Please type them again."; else if ($t_pass=='' or $t_pass2=='') echo "You left the password field blank."; else if ($t_mail=='') echo "You left the email field blank."; else { echo "Thankyou for registering. An email has been sent to the email address you supplied. As soon as you click the link in that email, you'll be able to start posting!"; //register } } ?> </CENTER>
-
I may be wrong, but every time i see a cookie called,
the word cookie is always in caps, i dont know if thats
mandatory, but you may need to change that. You also
need quotes around basketid, also, you never set a
time on the cookie, if you want a week, do this:
if (isset $_COOKIE['basketid']) { $yourbasketid = $_COOKIE['basketid']); } else { echo "ohw your a new user lets create a basket fo you bitch"; setcookie('basketid',$ip.$randomcode,time+60*60*24*7, (bloody ages)) }
-
Immediately after running you nl2br run...
str_replace('<br />', '\\t\\t<br />', $the_string_in_question);
im just editing his code,
str_replace('<br />', "\t\t<br />", $the_string_in_question);
i just replace the single quotes with double quotes and took out
a back slash before each t, that should do the trick
-
do this:
str_replace('<br />', "\t\t<br />", $the_string_in_question);
-
"Crawlers will ignore the parameters (everything after the ?), so the only page that gets indexed is the default page."
Incorrect. Not that it's a bad idea to optimize your URLs as described, but I've got hundreds of ?=blahblah pages indexed in all search engines.
yea i agree with BlueSkyIS,
not all search engines ignore that,
some do, but the major ones like google and yahoo dont
-
ahh
so it would be like
if($page == loging){
include login.php?
}
it would be more like
<?php $page = $_GET['page']; if($page == 'loging'){ include('login.php'); } ?>
-
replace echo $sql;
with mysql_query($sql);
-
do you mean something like
http://www.website.com/?page=home
if so,
in your index.php page make your file include certain files
depending on which page is called through $_GET['page']
-
what version of PHP are u running?
-
I think you should store their member id and their encrypted password. Then on every single page you should check to make sure the user id matches the encrypted password. This is because it is easy for users to edit their cookies and view their cookies.
It's better to use sessions though. To the coder they work almost exactly the same, but a user can't edit session variables. So once you've checked their password you don't have to check it again.
even if the password is encrypted its not that smart to put it in the cookie....
-
well cookies can be faked so you need to make it
so that you can decode it and it will be hard to fake.
maybe type in a random string and mix in the member id,
something like:
nfitrn4ql5roqj432io4j23432oj42n-{member id}-enk34b32k5b3
(without the brackets)
then do something like
<?php
$blown = explode("-", $_COOKIE['memberid']);
$id = $blown[1];
// then make sure the id is valid
$query = mysql_query("SELECT * FROM `table` WHERE `id` = '$id'");
// then show the content after checking if it exists
if(mysql_num_rows($query) == 1){
// show content
} else{
// show an error saying that his/her account was not found
}
?>
thats a simple example of how to do it,
good luck.
-
does it report back any errors?
-
yea what you're trying to do really doesnt make sense,
cURL() is more for posting data and other stuff. what
you are trying to do can be done by either including that
file or just simply writing that code in page1.php
-
you can do this:
<?php /* run your PHP script.... */ ?> <html> <!-- display HTML content --> </html>
or it can be like this too
<html> <!-- some html --> <?php /* some PHP */ ?> <!-- more HTML --> </html>
-
it can be in an array,
maybe you can put something like this on your form:
<input type="checkbox" name="pepsi" value="1.00" />Pepsi<br />
<input type="checkbox" name="coke" value="1.25" />Coke<br />
<input type="checkbox" name="sprite" value="1.50" />Sprite
then on the php that processes it just do something like this:
<?php $soda['pepsi'] = $_POST['pepsi']; $soda['coke'] = $_POST['coke']; $soda['sprite'] = $_POST['sprite']; foreach($soda as $name => $value){ echo "You purchase a $name for \$$value<br />\n"; } // if you want to add them.... echo "Your total price is ". array_sum($soda); ?>
-
you will have to change the extension of your page to .php though, or they will not be noticed as PHP by the browser.
not really,
you can just make setup your server to read php in html by way
of mime types.
-
look up $_POST
-
well did u set $id
-
well it depends on what exactly you are trying to do....
-
u can just insert the value (true or false) into a mysql database
and then grab the value in your script.
-
echo $_COOKIE['cookie_name'];
-
60*60*24*100
60 - 60 seconds = 1 minute
*
60 - 60 seconds * 60 = 1 hour
*
24 - 1 hour * 24 = 1 day
*
100 - 1 day * 100 = 100 days
-
are you sure $id was set correctly?
getintouch.php
in PHP Coding Help
Posted
well in your code i dont see $redirect getting established
and you are saying to display the error if $error is empty....