
Lyleyboy
Members-
Posts
149 -
Joined
-
Last visited
Everything posted by Lyleyboy
-
Using mod rewrite in root and then a subfolder
Lyleyboy replied to Lyleyboy's topic in Apache HTTP Server
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] -
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
-
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
-
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
-
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.
-
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.
-
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.
-
How Do I Create A Link From Part Of The Text In A Database?
Lyleyboy replied to FoxRocks's topic in PHP Coding Help
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. -
You could select distinct and limit 1 ordered by the id.
-
Hey, You could do with posting some code or something. Not sure what you're trying to achieve.
-
Hi, Thanks for that but I'm afraid neither worked. I'm really at a loose end.
-
Anyone have any ideas?
-
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(' ', '<br/>', $notes); and str_replace(chr(10), " ", $notes); Please help
-
Read about regular expressions.
-
two POST variables get recognized the third not...
Lyleyboy replied to clausowitz's topic in PHP Coding Help
The thing is when your returning an image there is no value so nothing will show. -
You need to use IF statements, with regular expressions if you'd like. You'll need to check that each form field has been completed and that it is x characters long. Only once all that is done can you submit the content. Hope this helps. <?php if($_POST['fieldName'] == ''){ //fail } else { //Worked } ?>
-
Could be && in your query instead of AND
-
I think what you need to do is to formulate your variables so:- $id = $_GET['id']; $userkey = $_GET['userkey']; I believe the issue is that the php does not always know for certain what the variable contents are.
-
Showing different contents in one template
Lyleyboy replied to fluidsharp's topic in PHP Coding Help
Not sure what you are getting at. -
Ideally you would store each form field separately. The code you are looking for is something like Inside your record set while if($row['red'] == 1){ echo "<input type="chcekbox" checked"/>"; } else { echo "<input type="chcekbox""/>"; } So if the field is set in the recordset the checkbox will display correctly. Tadaa
-
Try looking into DOM scripting. If the syntax is always the same you could find each part using JavaScript.
-
I was just about to say, the best bet would be to store the counties in a database table.
-
Were going to need to see some code. If they are in a database just iterate through the DB
-
Do you have a question?