Jump to content

smarble53

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

smarble53's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Shouldn't the array have key values? i.e. $row[5] i dont know off of the top of my head if it does that or not from the mysql statement.
  2. http://home.bolink.org/ebooks/webP/pcook/ch04_26.htm i've had to use that once, and it works pretty well.
  3. You could try validating with javascript. Tizag.com has a great tutorial on this at http://www.tizag.com/javascriptT/javascriptform.php . it just takes the values, validates them, and displays an alert and will not submit. if there are no errors, the form will submit. I have grown to love this script, as it is quick and easy to use, even for someone who does not know a heck of a lot about javascript.
  4. QUESTION 1) try this. it works when i have it set to .php: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ $1.png [L,QSA] RewriteRule ^(.*)$ $1.jpg [L,QSA] RewriteRule ^(.*)$ $1.jpg [L,QSA] and so on... QUESTION 2) this is what i do: $username = $_SESSION['username']; $target = "./photo/"; $filename = $_FILES['uploaded']['name']); //gets the file name - file.jpg $targetnew = $target.$username."/".$filename; // $target = $targetnew;unset($targetnew); $ok=1; if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploaded']['name']). " has been uploaded"; i'm sure there are other more reliable and smiled-upon ways to do this, but this is how i get the name and extension seperately: $filename = $_FILES['uploaded']['name']; $filenamearray = explode(".", $filename); $name = $filenamearray[0]; //the part before the first period $ext = $filenamearray[1]; //after the period so in theory, $_FILES['uploaded']['name'] should be the same as $name.".".$ext . before i upload the files, i make sure there is only one period in the filename.
  5. "http://www.example.com/index.php?page=page1&id=4&color=blue&fruit=apple" => => => "http://www.example.com/index/page/page1/id/4/color/blue/fruit/apple" im not sure if this rewrites it, but if you do write the second url, it will recognize all of the variables from the first url. i use this for all of the sites i create. i cannot remember where it came from, but it works for what i do. just add the below to the .htaccess file. RewriteEngine On RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$ RewriteRule \.(css|jpg|jpeg|gif|png|js)$ - [L] RewriteRule ^([^/\.]+)/?$ index.php?page=$1 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&$2 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&$2=$3 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&$2&$3 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&$2&$3&$4 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&$2&$3=$4 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&$2=$3&$4 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&$2&$3&$4&$5 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&$2=$3&$4=$5 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&$2&$3=$4&$5 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&$2=$3&$4&$5 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&$2&$3&$4&$5&$6 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&$2=$3&$4&$5&$6 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&$2=$3&$4=$5&$6 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&$2&$3=$4&$5&$6 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&$2&$3&$4=$5&$6 [L] RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&$2&$3=$4&$5=$6 [L]
  6. It seems to be working for me. BUUUT... Why is there a second curly brace after this? is it in another if or while loop?
×
×
  • 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.