Jump to content

fry2010

Members
  • Posts

    326
  • Joined

  • Last visited

Everything posted by fry2010

  1. I think it has something to do with having two conditions that can be treated the same. Because when i place two conditions exactly the same then it gives server error. example: RewriteCond %{REQUEST_URI} ^/www.mysite.com/(.*)(/*)$ RewriteRule ^(.*)$ /www.mysite.com/index.php?aff=$1 [QSA] RewriteCond %{REQUEST_URI} ^/www.mysite.com/(.*)(/*)$ RewriteRule ^(.*)$ /www.mysite.com/index.php?loadPage=$1 [QSA]
  2. tried that, but still gives server error. Strange because when I place them the other way around there is no server error.
  3. actually I am having a problem trying to get that to work. RewriteCond %{REQUEST_URI} ^/(.*)/page([0-9]*)$ RewriteRule ^(.*)$ /www.mysite.com/index.php?special=$1 [QSA] RewriteCond %{REQUEST_URI} ^/www.mysite.com/(.*)$ RewriteRule ^(.*)$ /www.mysite.com/index.php?loadPage=$1 [L,QSA] I get an internal server error. Exceeds 10 internal redirects in error log. I have tried them the other way around but that will mean the second condition will never be matched because the first allows for all to be matched. So they need to go this way around. (Which I assume is why you said to use the specific one first...)
  4. cheers gizmola, suppose that is the best way to go.
  5. thanks, thats good to know, but not what I needed it to do. I probably havnt explained very well. Basically I want the first condition to rewrite to the GET variable '$1', and then IF the second condition is also met, then provide that as the second GET variable '$2'. If it does not find the second condition then still perform the rewrite and pass the first variable.
  6. I wish to achieve the following: Redirect www.mysite.com/dir1/dir2 to www.mysite.com?page=$1 At the same time see if there is a specific directory called 'specialpage' and then redirect to www.mysite.com?page=$1&special=$2 I can get the first rewrite to work, but when I try to see if special page is there and pass as a second parameter it stops working if that special parameter does not exist. I know the reason why it does not work, but I dont know what the solution is. Here is what I have so far: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^/www.mysite.com/(.*)$ RewriteCond %{REQUEST_URI} ^/(.*)/page([0-9]*)$ ##This is the special page RewriteRule ^(.*)$ /www.mysite.com/index.php?loadPage=$1&special=$2 [L,QSA] The reason it wont work is because when it gets to the second rewrite condition, if it does not match that condition then it will not perform the rewrite rule. I need it to work so that if it does not match the second condition then it will still perform the rewrite rule but leave out the second GET variable. Hope this makes sense.
  7. thanks, I think I will invest in a book. Served me well before when I got one on php and css.
  8. great, thanks for your help. I really dont understand how you can solve this problem so easy, where do you learn to do this kind of thing?
  9. My in-experience in using join statements has come-a-cropper for me, and Im not even sure if that is what is required here. Here is the situation: I have two tables. Table two has a column with a foreign key to table one. I want to select certain column data from table one, but at the same time count(*) how many rows in table two are linked to table one. I know this can be done easy using two statments seperatly, but I imagine there is a solution using just one query. Here are the two table examples: create table table_one ( id int unsigned not null AUTO_INCREMENT, name char(60) not null DEFAULT '', status tinyint(1) unsigned not null DEFAULT 0, PRIMARY KEY (id) ); create table table_two ( id int unsigned not null AUTO_INCREMENT, table_one_id int unsigned not null, PRIMARY KEY (id), FOREIGN KEY table_one_id REFERENCES table_one(id) ON DELETE CASCADE ); Here are the two queries I wish to combine: $sql1 = "SELECT id, name FROM table_one"; $stmt = $conn->query($sql1); // Cycle through result while($fetch = $stmt->fetchObject()) { $table_one_id = $fetch->id; $name = $fetch->name; $sql2 = "SELECT COUNT(*) FROM table_two, table_one WHERE table_two.table_one_id = table_one.id"; } This would give a result like: Table One Id Table One Name Table Two Row Counts Linked 1 'this is first record in table one' 6 2 'this is second record in table one' 9 3 'this is third record in table one' 1 4 'this is fourth record in table one' 0
  10. hmm.. Ok thanks.
  11. thanks for checking it out, I am using version 9. I didnt quite mean the drop down menu itself, but rather that it creates a massive white gap between the header and the page content. Unless you do not see a big white gap there?
  12. I have just completed some updates to my site and have applied a drop down menu list using pure CSS. In I.E. it appears that it is forcing the main page down, and creates a gap that is the same distance that the biggest drop down list goes to. Check it out here: http://www.forextradingsignalservice.com Here is the CSS for the list link: #top-nav { bottom: 0px; padding-bottom: 12px; margin: 17px 0 40px 0; list-style-type: none; display: block; font-variant: small-caps; font-size: 85%; float: left; width: 100%; position:relative; z-index:5; } #top-nav li { float: left; position: relative; } /*--- #top-nav a { display:block; padding:5px; color: #ffffff; background: #000000; text-decoration: none; } #top-nav a:hover { color: #ffffff; background:#6b0c36; text-decoration: underline; } ---*/ /*--- DROPDOWN ---*/ #top-nav ul { background: #ffffff; background: rgba(255,255,255,0); /* TRY TO MAKE INVISIBLE - KEEP THIS */ list-style:none; position: absolute; left: -9999px; /* THIS WILL HIDE THE DROP DOWN LIST WHEN NOT USED - KEEP THIS */ } #top-nav ul li { padding-top: 1px; float: none; } #top-nav ul a { white-space: nowrap; } #top-nav li:hover ul { left: 0; top: 32px; background-color: #242424; padding-bottom: 4px; } #top-nav li:hover ul a { /* The persistent hover state does however create a global style for links even before they're hovered. Here we undo these effects. */ text-decoration: none; } It works fine in firefox and chrome.
×
×
  • 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.