Jump to content

Lyleyboy

Members
  • Posts

    149
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://www.smileyhappycoder.co.uk

Profile Information

  • Gender
    Male

Lyleyboy's Achievements

Member

Member (2/5)

0

Reputation

  1. Ok, I've fixed this now. All I needed to do is add the subfolder into the script inside the admin folder. RewriteEngine On RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.*)$ /admin/index.php?id=$1 [L]
  2. Hey all, I have a site that uses mod rewrite. It's working fine for the main site. Now I need to build an admin panel and I'd like that to use mod re write too. So www.site.co.uk/controller/method works fine but www.site.co.uk/admin/controller/method breaks However www.site.co.uk/admin works fine. Admin is a folder that exists. My .htaccess looks like this RewriteEngine On RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.*)$ /index.php?id=$1 [L] Nothing fancy there. So what I have done is to add this same .htaccess file to the admin folder in the hopes that it would work. It hasn't. When you go to this page it just breaks because the first level doesn't see it as a controller and so fails. What can I do to make this work. Can I add something to the htaccess in the root to handle it. Thanks in advance
  3. Ok, thanks AyKay I'll give it a shot.
  4. Yeah I accept that and I always code round it, to ensure that the value is present and in the correct format. So what's the easiest way then? Do I still have to loop through, even though there will only be one record posted. I'm kind of hoping there will be an easier way. Thanks
  5. May be me misreading but that seems to loop through a record set. What I'm looking for is a query that will only ever return one value which then dumps the value into a variable. Cheers
  6. I don't see why it couldn't work using $_SERVER['REMOTE_ADDR'] I'm maybe store an array in a session with a count.
  7. Hey all, I'm just starting to get on the PDO bandwagon with PHP. One thing I do a lot is to fetch the result of a query straight into a variable using list. Something like list($name) = mysql_fetch_row(mysql_query("SELECT name FROM names WHERE userID='1'")); Is there a similar thing I can do with PDO rather than having to loop through with a while or similar. Thanks in advance.
  8. Hey, I'm really after some advice on how to go about a task I have to do. I have written a small php/mysql app for my work that stores basic info about our customers. It's really very simple. What I have now been tasked to do is to add a project/task manager to it. The idea being that user1 is blocked out to work on project1 for three hours today and project3 for four hours. My issue is that I'm not sure how to go about blocking the time slots out in mysql. I don't really want to have to create slots in a database for every hour of every day. That seems a bit counter intuitive. Any genius plans that I'm going to slap myself for not coming up with myself. Thans folks.
  9. I'd say the best bet would be to write a function to replace the string "Contact Us" with the link to that page. Regex should do that for you. If you're using a CMS you could list out the pages and find the page name and replace that with the <a href="contactus.php">Contact Us</a> structure.
  10. You could select distinct and limit 1 ordered by the id.
  11. Hey, You could do with posting some code or something. Not sure what you're trying to achieve.
  12. Hi, Thanks for that but I'm afraid neither worked. I'm really at a loose end.
  13. Hi, I'm looking for a bit of help. I have a record in a MSSQL. I'm using PHP to pull that record. In the record there are the funky square characters for chr(13) and chr(10). In PHP they are totally ignored which means that the record appears on one line. I have tried replacing these with various a numerous characters but no joy. Things like str_replace('&#10;', '<br/>', $notes); and str_replace(chr(10), " ", $notes); Please help
  14. Read about regular expressions.
×
×
  • 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.