Jump to content

jjacquay712

Members
  • Posts

    197
  • Joined

  • Last visited

About jjacquay712

  • Birthday 08/12/1993

Contact Methods

  • AIM
    johnjjacquay

Profile Information

  • Gender
    Male
  • Location
    Niceville, Florida

jjacquay712's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. What is the error you are getting when you can't open a file? If it is the one I'm thinking of you might me able to use this line: <?php ini_set('memory_limit', '512M'); ?>
  2. Essentially what a .bat file does when it is run, is takes each line and runs it as a command in command prompt. What you could do for testing is just open up a command prompt window (Start > All Programs > Accessories > Command Prompt) and paste the line: php "C:\Path_to_your_script\script.php" The command prompt window will stay open so you can see any error that is reported. If you see any errors you can post them and I can try to resolve them.
  3. I forgot to address your question about having the description of the mysql row in the url instead of the ID. You would need to create a new field in your table called "seo_url" or something similar. Whenever you are inserting a row into your table, you would need to also populate your new field. I made a function you could use the convert the description to put in your seo_url field: <?php function pretty_url($name) { return preg_replace("/[^0-9,a-z,A-Z,-]/", "", str_replace(" ", "-", strtolower(trim($name)))); } ?> Now when you are selecting the row from your php file, the sql query would need to look like this: SELECT * FROM `my_table` WHERE `seo_url` = '{$_GET['request']}' LIMIT 1;
  4. The first thing you will need to do is edit your .htaccess file to look something like this: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ router.php?request=$1 [L] </IfModule> This takes all requests that aren't referencing a file or directory, and sends to your script named router.php. It passes the string of your request to a $_GET variable called request. For example, if you went to the page http://www.example.com/test, the request would look like this: router.php?request=test. You could then access the request with $_GET['request'] from within router.php. This is what my router.php looks like: <?php error_reporting(0); if ( $_GET['request'] ) { $page = $_GET['request'] . ".php"; if ( file_exists($page) ) { require_once($page); } else { require("404.php"); } } else { require('index.php'); } Just make sure you can't include remote files or you will have a RFI vulnerability. Hope this helps. If you have any other questions you can post them or PM me.
  5. If You are using Windows, you could create a batch script to run the php script for you. I'm a little rusty on it but if you open up a new file, paste this: @echo off php "C:\Path_to_your_script\script.php" and save it as a .bat file, you can double click it and it will run. Just make sure you have PHP installed.
×
×
  • 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.