Jump to content

LINK With Spaces Wont be renamed to Without Spaces


Ziph

Recommended Posts

For some reason it wont add _ for where the spaces are

 

this is the outcome of this code

(Ziph) () test test test = fixedlink http://www.gosuhosting.com/upload/Ziph/0028 shakaalxZ ZiphP.rep = mustfixlink

 

<?php

// Start a session

session_start();

// Sends the user to the login-page if not logged in

if(!session_is_registered('member_ID')) :

header('Location: ../login/login.html?msg=requires_login');

endif;

// DB connect ifno

include '../mysql/db.php';

// functions

include '../mysql/functions.php';

 

$username = user_info('username');

echo "($username) ";

echo "($filename) ";

 

$filename = $_GET["msg"];

 

$filelinkconstruct = mysql_query("SELECT filelink FROM uploads WHERE username='$username' AND filename='$filename' ");

while($fix = mysql_fetch_assoc($filelinkconstruct)) {

$mustfixlink = $fix['filelink'];

};

 

$fixedlink = preg_replace('[%[\s]+%]', '_', 'test test        test');

echo "$fixedlink = fixedlink";

echo "$mustfixlink = mustfixlink";

 

?>

 

test test         test is ofcourse in the final version to be replaced with $mustfixlink but the test test test is to test it hehe i also tried to rename the file also didnt work.

 

this preg_replace code does work with other people so i dont know what im doing wrong.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.