Jump to content

mcdsoftware

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://mcdsoftware.com

Profile Information

  • Gender
    Male
  • Location
    Philippines

mcdsoftware's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks cags. I tried that but it just goes into an infinite loop. I think that's because the condition that checks for the wildcard subdomain is always true and it redirects it everytime to /partners/xxx/xxx. Is there any flag that I could use to stop the loop after the first request/redirect? Thanks again.
  2. Hey guys, I've been trying out different things for several days now and have finally decided to ask for help. So here's the situation, we have a site (domain.com) and wildcard dns is setup and working properly. entering someone.domain.com displays domain.com's content so all is good there. What I need is to process a different script (note: not redirect, the url must be masked), like if the request is dummy.domain.com, it should mask the url to stay the same but really process /public_html/partners/dummy. It works as intended until I try to visit a directory like dummy.domain.com/files where it redirects the browser to domain.com/partners/dummy/files Here's what I have on public_html/.htaccess RewriteEngine On Options +FollowSymLinks RewriteBase / RewriteCond %{HTTP_HOST} !www.domain.com$ [NC] RewriteCond %{HTTP_HOST} ^([a-z0-9-]+).domain.com [NC] RewriteRule (.*) http://domain.com/partners/%1/$1 [P,L] If I try to visit a non-existent directory like dummy.domain.com/asdf, it works fine. The 404 says that it cant find the directory or file at partners/dummy/asdf so I'm thinking it must be something on the /files directory. Here's the htaccess under the files directory <IfModule mod_rewrite.c> RewriteEngine On Options +FollowSymLinks RewriteBase files/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^.*$ index.php [L] </IfModule> Hope you guys can help me out. Thanks!
  3. Try this and let me know if it works $sql = "DELETE FROM $tbl_name WHERE 1=1 "; // add row id to where section for($i=0;$i<count($_POST['checkbox']);$i++){ $sql .= " AND ID='" . $_POST['checkbox'][$i] . "',"; } $sql = rtrim($sql, ',');
  4. Check my last post. I edited it to add some codes
  5. Depending on your php.ini, session variables could be stored using cookies so they will be created automatically even if you don't call setcookie To check whether or not a user has access to a specific page, add this to the top of the pages that you want to secure: <?php session_start(); if (! isset($_SESSION['privilage'])) { // privilege? // redirect to your login page header("Location: loginpage.php"); exit; } else { // check to make sure the privilege is correct for this page // modify as needed if ($_SESSION['privilege'] != 'manager') { die('You do not have the privilege to access this page.'); } } ?> HTH
  6. Yep, if you can, give yourself permission to read/write on /var/www/vhosts/domain.com
  7. Not sure I understand where you're going with this but try: $str = ''; foreach ($_POST as $key => $value) { $str .= '$'. $key .' = $_POST[\''. $key .'\'];' . "\n"; } // write $str to a txt file file_put_contents('file.txt', $str);
  8. I just tested your code and it does list all my session files so it looks like it's working . Try to check if you have read access to the tmp directory. Maybe try fopen-ing a session file to see if there will be any errors.
  9. Not sure about #1 but to answer #2, see http://php.net/extract. // $_POST = array('address' => '123', 'name' => 'John Doe'); extract($_POST); echo $address; echo $name HTH
  10. Assuming from your title that $row['date'] is a valid timestamp, try: echo date('F d, Y h:ia', $row['date']); HTH
  11. Have you tried using glob instead of opendir? define("MAX_IDLE_TIME", 3); $sessions = glob(session_save_path() . '/sess_*'); $count = 0; foreach ($sessions as $session) { // do your expiry computation here... } Or you could always try changing the save path HTH
  12. I agree that sessions are much more secure than using cookies, but you could make it even more secure by changing the save path to something custom (instead of the default /tmp) and also try to read up on session hijacking articles.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.