-
Posts
1,025 -
Joined
-
Last visited
Never
Posts posted by Caesar
-
-
What is the error you're actually getting/seeing?
-
You can use sessions or cookies. Or both even. To call them any time while they're on your site, you simply initialize the session on every page you want to use them on...
<?php session_start(); echo'<div class="login_status">You are logged in as '.$_SESSION['username'].'</div>'; ?>
-
Is this a Windows server? And is safe mode enabled in the PHP configuration?
-
<?php while($infoc = mysql_fetch_assoc( $resultc )) { if(($infob['amount'] != '') && ($infoc['name'] != '')) { echo "<tr>"; echo "<td>".$infob['amount'] . " ".$infoc['name'] . " </td> "; } } echo "</font>"; echo "</table>"; ?>
-
Use a combination of session/cookies. And if possible, use encryption.
-
Tons out there. But posted in the wrong forum. THis forum is for troubleshooting existing code.
Good luck in your quest.
-
Yeash...I havent looked at it in detail but as far as the extra parantheses goes...highlighted it for you...
if(preg_match('/\A(?:[a-zA-Z0-9]!#$%&\'*+\/=?^_`{|}~-])+(?:\.[a-zA-Z0-9]!#$%&\'*+\/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-z0-9])?\.))+(?:[a-zA-Z]{2}|com|org|net\b)\Z/i',$email))
-
You have an extra parentheses in your regex. I can see it right away.
-
Ajax/Javascript.
-
You would need to show the code you're using in the php file where you're calling the image from. That's likely where you're error is.
-
Yeah...this is more of a PHP troubleshooting forum. Though I commend you on looking into CSS. As it is much much better to use CSS/DIVs (Some occasional use of tables..properly structured using correct syntax isn't a bad thing) with clean designs.
Firstly, there's nothing wrong with Tables...
I wrote a paper about it.
JAWS is one of the most popular screen readers and their website uses tables, so it's really not a problem provided that you use them properly.
Their site also fails validation
May work...but for any commercial entity, it looks pretty unprofessional to not write clean code that validates. It also looks like it was designed in 1997. LOL. No offense. Continue...
-
Glad you've got it figured out.
Happy coding
-
Does this yield different results.....
<?php if ($row[health_safety] == 'Yes' || $row[investigator] == 'Yes') { echo "hello"; } else { echo "I hate your face. Die."; exit; } ?>
Also...you did print out the values to see if they were outputting 'Yes' or 'No', right?
-
A simplification...
<?php $usrip = $_SERVER['REMOTE_ADDR']; $usrname = $_SESSION['username']; $banlist = file_get_contents('banlist.txt'); if((preg_match('/'.$usrip.'/i', $banlist)) || (preg_match('/'.$usrname.'/i', $banlist)) || ($_COOKIE['banned'] == '1')) { header("Location: index.php?notice=banned"); exit; } ?>
And in index.php you set your cookie.
And sure...they can clear their cookies. But every time they get banned...they have to take extra steps to get to your site. At that point, they have to start wondering what the hell they're doing with their spare time. They've got issues. :-P
-
But in some cases...it helps as a deterrent. I say do both username and IP bans....and store it in a cookie as an additional step...just an extra step to annoy them more. The method depends on how you're storing the banned users...MySQL database? Flat file?
-
Are you including the file that does the incrementing, in on another php file?
-
Not entirely true. On many 'shared' hosting plans that use stuff like cpanel, they will allow you to set up your own cron jobs. Fairly easily too.
-
Why not make it simple and redirect them?...or even display the content only if they are a certain user level?
<?php echo' <html> <head> <title>Blah blah blah</title> </head> <body>'; if($_SESSION['admin'] == 1) { //Load admin content } echo' </body> </html>'; ?>
-
i want to inform through email to my clients in a particular time automatically , how to do it ?
Cron job.
-
You're outputting something before the header again. Remove your comment at the top of the page, make sure you don't leave any white space before the opening PHP tag, and add your comments after...within the PHP (using PHP comments with slashes or '/* Comment here */')...and also initialize the session after the header function.
-
Not sure what you mean by that...my example was showing that you can determine what error they made so that you can then use a conditional statement to echo out a notice in the page they are redirected to.
Example...
<?php if(isset($_GET['error'])) { $error = $_GET['error']; if($error == 'wronguser') { echo'You did not enter the correct username'; } if($error == 'wrongpass') { echo'You did not enter the correct password'; } } ?>
Etc...etc. You can of course use swirches...or in fact...use a different approach altogether...but the point was, you can't echo out something and then output the header.
-
You can't do...
<?php echo "Please make sure all fields are filled."; header("location:index.php"); ?>
If you want to pass a notice or error to the next page do it through the url...
<?php header("location:index.php?error=$error"); ?>
Then grab it on the next page...
<?php $notice = $_GET['error']; ?>
-
You can't echo or output anything before outputting the header.
-
Where in your code did you specify you wanted to pass the value of page through the url?
Microsoft Frontpage
in PHP Coding Help
Posted
Front Page may make it so that you don't have to put much thought into what you're doing...but it generates invalid code that does not adhere to web standards and does not display the same across the different browsers.
And to answer your question....PHP and Frontpage are not friends.