-
Posts
1,025 -
Joined
-
Last visited
Never
Posts posted by Caesar
-
-
Why not keep ANY data from submitting, unless the user inputs a valid date? Maybe I just need to know a little bit more about what you're trying to do....
-
That isn't the complete line in 111 right?
-
I'm sure you can do this with cURL.
-
You really don't want to do it in 100 different PHP pages. Instead, use methods (See OOP) or functions...all within a single PHP page. That being said, it's possible to display anything you want on a conditional basis. What you're asking is basically the basics of if/else 101.
Something like....
<?php function loadpage($var) { // Your code here } if($_SESSION['loggedin']) loadpage('members'); else loadpage('login'); ?>
There's of course different approaches, techniques...etc. But yes, more than possible.
-
Can you show us the code where you're setting the session variable in question? Thanks.
-
The sessions should not be destroyed, unless the browser is being closed, or you probably can't print out the values if you're not initiating the session again in the script/page they are coming back to. If you aren't, then the session variables won't be recognized.
-
You can't do it all on the same page. Not using that approach, no. Why not just create a downloadable zip/archive of the files they want and have it as a single download?
-
Javascript is your friend.
-
You can always do something like...
<?php $img_name = md5(time()).$extension; ?>
Not very likely you'll have duplicates unless, the time/date on the server is changed.
Edit: I assume you're going to store/log the fact they uploaded an image in your db. So yeah, you store the image name and in the same table, the user id associated with it.
-
-
So it becomes an issue when your number is negative or less than zero?
If I understood you right, try this...
<?php //Do this check before your other conditional statements... if($number < 0) $number = 0; if($variable > $number) { //Do the dew man. } ?>
-
Try using 1-9 (1 through 9) when setting the image quality. It's been a while since I had to use image functions but if I remember, this is different when using ImageCopyResampled() (Which let's you set quality by %).
-
User accounts with a messages table linked to their id, stored in a MYSQL database would be one approach.
-
Does your host support dynamic loading? If so, Source Guardian provides the files on their site.
-
-
Well, your question wasn't very specific. What exactly are you checking? User input? A record stored in a database? A string?
Anyway...assuming it's a string or something manually entered in a form (Bad idea to let people enter dates without forcing the format yourself)....
<?php if(!preg_match('/[0-3][0-9]\/[0-1][0-9]\/2[0][0-9][0-9]/', $date) Errors('date'); //Assuming you wrote an Errors() function. else echo 'Email is formatted correctly'; ?>
-
Where's your login script? In it, do you set a cookie or session variable that contains the user's id or username?
-
You're not specifying any criteria in your MYSQL query. You're selecting ALL users...since you're not looping through results, it's likely showing the username alphabetically, in descending order.
-
-
<?php $message = htmlspecialchars(strip_tags($_POST['message'])); ?>
-
Look into Object Oriented Programming (OOP). You may not use it for smaller tasks/scripts but when doing commercial/paid work, it makes more sense. It also encourages clean/organized code and will keep you from using repetitive code.
-
Even a better idea...CSS:
#techcone { font-size: 11px; color: #FF9900; font-family: book antiqua; }
<html> <head> <title>More Cowbell</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="robot" content="index, follow" /> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div id="techcone"> The font size, color and font family have been defined in your CSS!! </div> </body> </html>
Now....if you are trying to make it dymaic (Your example code isn't clear, as you're using a non HTML tag), you'd use a different method. But you can even use a dynamic style sheet for that as well.
-
Where's the part where you actually set SESSION variables and assign values to them?
-
phpBB is using whatever the site/IP is in the settings. To change it to domain, simply login to your phpBB admin and edit the main settings. That's it.
Also...not a PHP programming question :-P
Fitting an HTML conditional comment inside a php code. Is not working for me
in PHP Coding Help
Posted