-
Posts
1,025 -
Joined
-
Last visited
Never
Posts posted by Caesar
-
-
Sessions table in your MySQL database. That is all. Over & out. :-P
-
Why not just use the header function?
<?php header("location: main.php"); ?>
-
or die mysql_error());
seeing any lopsided parentheses in there? i do.
Good catch.
-
<?php $folder_info = mysql_query("SELECT * FROM foldersmain WHERE $folder_column = '$folder_value'") or die mysql_error()); ?>
Remove the single quotes around the column variable. Try that. Otherwise...is that all the code on the page generating the error?
-
Folder permissions for starters? Lotta times when you upload files it will default to 644/755...in which case, you won't be able to write to the folder you're in.
-
Hmmmglad you got it. Although if that didn't work..means your "timestamp" isn't really a timestamp. :-) It must be formatted or stored as an actual DATE.
-
If stored as a timestamp...you don't need to do a whole lot. In fact, works much nicer when it is a timestamp...
<?php $formatstamp = date("M d, Y",$info[time]); echo $formatstamp; ?>
That's it.
-
Be much easier if you processed the form on the same page. You can include the code that does it, if the $_POST array has been set. *SHRUGS*
-
Things you can do to improve
1. Layout/design - Use CSS
2. Take an OOP approach to your script.
-
If you are on a *nix based server that supports POSIX 1003.2 regular-expressions...
# Rewrite <subdomain>.example.com/<path> to example.com/<subdomain>/<path> # # Skip rewrite if no hostname or if subdomain is www RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST} !^www\. [NC] # Extract (required) subdomain (%1), and first path element (%3), discard port number if present (%2) RewriteCond %{HTTP_HOST}<>%{REQUEST_URI} ^([^.]+)\.example\.com(:80)?<>/([^/]*) [NC] # Rewrite only when subdomain not equal to first path element (prevents mod_rewrite recursion) RewriteCond %1<>%3 !^(.*)<>\1$ [NC] # Rewrite to /subdomain/path RewriteRule ^(.*) /%1/$1 [L]
-
Neither....
<?php echo' <form method="post action="'.$_SERVER['PHP_SELF'].'"> <table> <tr><td><input type="text name="nombre" value="'.$_POST['nombre'].'"></td></tr> <tr><td><input type="submit name="submit value="doit!"></td></tr> </table> </form>'; ?>
-
If you don't have the server setup to parse PHP in HTML pages...then you need to rename the file extension to .php.
-
If you want the HTML to be parsed as HTML...
<?php echo '<a href="mypage.htm">My Page</a>'; ?>
-
If you want the html code to display as HTML....and not have it parse as HTML...
<?php $string = '<a href="mypage.htm">My Page</a>"; $newstr = htmlentities($string); echo $newstr; ?>
-
Not sure what you're asking. Do you want to echo out actual code? Is that what you're asking?
-
Yes, I saw the subdomains. Reread my post. You can use something like the Apache mod_rewrite
-
Nevermind...re-read. Using subdomains.
You can use mod_rewrite if you're on an Apache server.
-
Before trying to display your image, you need to debug your code/php to make sure you're pulling the value correctly from the database. You also need to make sure you're specifying the correct image path.
<?php $query = $db->query("SELECT * FROM usrinfo WHERE id = '$id'"); $usrinfo = $db->fetch_array($query); echo'<img src="images/'.$usrinfo[uid].'jpg" alt="image info" />'; ?>
-
So its better to have few tables that have a lot of records, then a lot of tables and a few records?
Yes.
-
Millions of Tables? Or millions of records? If we're talking tables...I would not recommend MySQL.
-
If the host/server configuration allows for run-time loading, you can upload the loader to an "ixed" folder.
-
base_64_encode ain't the answer. Easy to reverse.
If you develop scripts often...SourceGuardian/Zend Guardian. But then, if they really wanted to, they don't need to see the code to steal a layout.
-
Just do a search on their site. You can tell how it's passing the values.
-
Missing one last closing bracket at the bottom....from the else statement.
[SOLVED] users logged in
in PHP Coding Help
Posted
If you use a sessions table, you update the session time in the database everytime a user loads a page. You then log them out if a session update time is a certain amount of time greater than the session start time. Everytime it updates it checks...etc. So it will be as accurate as you can get within a few minutes time.