Jump to content

Lambneck

Members
  • Posts

    268
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Lambneck's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Theres this script floating around the web that replaces special characters with dashes but instead I would like specifically punctuation to NOT be replaced with anything but to just be removed... no white space, no dash. example: today's weather is hot! good:: todays-weather-is-hot bad: today-s-weather-is-hot- This script replaces does that bad example... how to make it do the good?: function secUrl($string){ $string = strtolower($string); $string = preg_replace('/[^a-zA-Z0-9]/i','-',$string); $string = preg_replace("/(-){2,}/",'$1',$string); return $string; }
  2. Win! This is it: RewriteEngine On RewriteRule ^update/([0-9]+)$ update.php?id=$1
  3. So I have the below code doing two things. The first part removing .php extension from urls and the second part redirecting from a clean url to the original. Its the second part of this that is not working and I dont know why and am hoping and praying someone here can help with this. I have tried many different tutorials with different approaches and still no luck. Below is the most basic of the attempts I have tried and from what I can tell it SHOULD work, but alas... Anyway its trying to get the clean url example.com/post/2 to redirect to example.com/post.php?id=2 Please help! RewriteEngine On #remove .php extension RewriteCond %{REQUEST_FILENAME}.php -f RewriteCond %{REQUEST_URI} !/$ RewriteRule (.*) $1\.php [L] #redirect RewriteRule ^/post/([0-9]+)$ /post.php?id=$1
  4. Ok thank you very much!" Clean URLs", now i got the nomenclature and now I have some functions that strip special characters but how do I acctually get the title into the url instead of the unique id and is there a clever way to still retain uniqueness of the url?
  5. Hi, I am trying to make my dynamic urls more attractive/memorable by using the associated blog entry's title instead of the unique id passed in the url. Currently the address looks something like the following: www.example.com/post.php?id=5 What I want it to look like is: www.example.com/title-of-article-goes-here Does anyone know a simple way to do this? Thanks in advance.
  6. Hi I followed these instructions http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-install-first-start.html and I keep getting the following errors when I try to start the manager: ndb_mgmd -f /var/lib/mysql-cluster/config.ini MySQL Cluster Management Server mysql - 5.5.25 ndb-7.2.7 2012-07-27 16:44:51 [MgmtSrvr] INFO -- The default config directory '/user/local /mysql/mysql-cluster' does not exist. Trying to create it... Failed to create directory '/usr/local/mysql/mysql-cluster', error: 2 2012-07-27 16:44:51 [MgmtSrvr] ERROR -- Could not create directory '/usr/local/mysql/mysql-cluster'. Either create it manually or specify a different directory with --configdir=<path> So I try to skip the cache and get the following ndb_mgmd --skip-config-cache -f /var/lib/mysql-cluster/config.ini MySQL Cluster Management Server mysql - 5.5.25 ndb-7.2.7 2012-07-27 16:44:51 [MgmtSrvr] INFO -- Skipping check of config directory since config cache is disabled. Failed to parse parameters for log handler: 'FILE:filename=/var/lib/mysql-cluster/ndb_1_cluster.log,maxsize=1000000, maxfiles=6', error:13 '(null)' I can not find anything on that second error. Has anyone done this before? Why is starting the manager such a pain?
  7. omfg it was the file collation. Changed the file encoding to utf-8 and worked perfectly
  8. Tried echoing variables from within processor.php including those from the load_data.php and nothing is displayed.
  9. Added three lines to the top of processor and name attribute to submit button. No change in result. Still no error message. Also checked server error logs and there was nothing relating to this issue.
  10. Upon submission of a simple form which should store user information in a mysql database, it instead does not submit any information and leaves the user at a blank page with the url site.com/php/processor.php ...Connection variables are assigned in load_data.php There are no error messages; nothing but white pixels. <?php if ( isset($_POST['submit']) ) { require_once('load_data.php'); if (!mysql_connect($db_host, $db_user, $db_pwd)) die("Can't connect to database" . mysql_error()); if (!mysql_select_db($database)) die("Can't select database" . mysql_error()); $title = mysql_real_escape_string($_POST['title']); $post = mysql_real_escape_string($_POST['post']); $address = mysql_real_escape_string($_POST['address']); $ip = $_SERVER['REMOTE_ADDR']; $insert = mysql_query("INSERT INTO $table (title, post, address, user_ip) VALUES ('$title', '$post', '$address', '$ip')") or die(mysql_error()); } header('Location: ../index.php'); exit(); ?> <form action="php/processor.php" method="post"> <fieldset> <legend>Submit</legend> <ol> <li> <label>Title</label> <input id="title" name="title" type="text"> </li> <li> <label>Post</label> <textarea id="post" name="post" rows=5 required></textarea> </li> <li class="hidden"> <label>Address</label> <input id="address" name="address" type="text"> </li> </ol> </fieldset> <fieldset> <button>Address</button> <button>Picture</button> <input type="submit" value="Post It"> </fieldset> </form>
  11. I reinstalled php today and now when I test phpinfo() within the IIS Manager it works fine. But when I try to open a .php file in the browser i get a blank page. Does anyone have any idea what I could be doing wrong? <html> <head> <title>phpinfo</title> </head> <body> <?php phpinfo(); ?> </body> </html>
  12. localhost/index.php <html> <body> <h1>Test Page</h1> <?php echo 'Hello World'; ?> </body> </html> what i wrote before with only closing tag is whats displayed when i open the .php file in browser. btw when i use php -info in the command prompt it looks to me as if it works as it lists a bunch of data instead of the previous errors that i had been getting. But still cant get it to work in the browser. I followed the instructions in the link provided earlier again and again. Not sure what I'm missing here.
  13. Hi, I have been messing with this for days now and its making me nuts!! I'm trying to install PHP on windows 7 using IIS. http://php.net/manual/en/install.windows.iis7.php I followed those instructions but when I open my index.php in a browser I get the following: Hello World!'; ?>
  14. $body = "<b><span style='color:#006699;'>" . $num . ": " . $user_name . ; also might want to double check the path to your image.
  15. Did you double-check to see if the paths were correct? If you are opening a file that is in a directory that doesnt have your css within it then you will need to add to go up a directory by prefixing your path with "../"
×
×
  • 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.