Jump to content

Search the Community

Showing results for tags 'slash'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 2 results

  1. I am trying to create a page for customers to enter their details. I am using a html form. When the submit button is pressed the form posts the inputs to the same page, which then checks if the inputs are empty. If they are not then each post variable is allocated a session variable so this info can be accessed late on in the system. If some of the inputs are empty then the value of the input forms become equal to the session variables that they were just allocated to so that the customer doesn’t have to retype their information. This is where the problem occurs. When I load the page each input box has a slash inside it and when the submit button is pressed a mother slash is added. My code is below: <?php session_start(); if(isset($_POST['NextPage'])){ if (!empty($_POST['CName'])){ $_SESSION["CName"] = $_POST['CName']; if (!empty($_POST['CStreet'])){ $_SESSION["CStreet"] = $_POST['CStreet']; if (!empty($_POST['CTown'])){ $_SESSION["CTown"] = $_POST['CTown']; if ($_POST['Counties'] != "-"){ $_SESSION["CCounty"] = $_POST['Counties']; if (!empty($_POST['CPostcode'])){ $_SESSION["CPostcode"] = $_POST['CPostcode']; if (!empty($_POST['CEmail'])){ $_SESSION["CEmail"] = $_POST['CEmail']; if (!empty($_POST['CNumb'])){ $_SESSION["CNumb"] = $_POST['CNumb']; $NotEmpty = true; }else{ $ErrorMsg = "Number is empty. </br>"; } }else{ $ErrorMsg = "Email is empty. </br>"; } }else{ $ErrorMsg = "Postcode is empty. </br>"; } }else{ $ErrorMsg = "County is empty. </br>"; } }else{ $ErrorMsg = "Town is empty. </br>"; } }else{ $ErrorMsg = "Street is empty. </br>"; } }else{ $ErrorMsg = "Name is empty. </br>"; } } $content = ' <h3 id="CTitle"> Customer Details </h3> <p><i>'.$ErrorMsg.'</i></p> <form action=" " method="POST" name="CDetails" id="CDetails"> Name: * <input type="text" name="CName" size="30" value='.$_SESSION["CName"].'/></br> First line of your address: * <input type="text" name="CStreet" size="40" value='.$_SESSION["CStreet”];.’/></br> Town: * <input type="text" name="CTown" size="25" value='.$_SESSION["CTown"].'/></br> Postcode: * <input type="text" name="CPostcode" size="11" value=‘.$_SESSION["CPostcode"].'/></br> Email address: * <input type="text" name="CEmail" size ="35" value='.$_SESSION["CEmail”];.’/></br> Phone Number: * <input type="text" name="CNumb" value='.$_SESSION["CNumb"].'/></br> <input type="submit" name="NextPage" value="Next" id="Next”/> </form> ?>
  2. Hello, For testing purposes I need to run site from /test_directory/, however every element in index.php and other places uses absolute path, e.g.: /styles/style.css /images/some_image.jpg I was trying rewriting base to /test_directory/ but unfortunately instead of reading from: www.mysite.com/test_directory/styles/style.css PHP is reading from: www.mysite.com/styles/style.css where that file of course not exists. I'm not familiar with RewriteBase, however I think it should work that way if I want change base dir to subdirectory. So I need to change absolute path to every single file and every link. Here we go with my .htaccess: RewriteEngine On RewriteBase /test_directory/ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.+)$ index.php?var=$1 [QSA,L] Any help will be appreciated.
  • 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.