Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About mickeymouse

  • Rank

Profile Information

  • Location
    France & Canada
  • Interests
    Databased Webs development

Previous Fields

  • Languages
  1. mickeymouse

    Height not working.

    OK. It looks like I'm using the wrong tag to get my box and write-up in the box. It seems I should be using Table tag which I've now tried. However, the width or max-width is not working. I show 50% but the box takes up the width of me widest line of text.
  2. mickeymouse

    Height not working.

    My css definition is: p.six {width: 50%; height: 250px; margin-top: 30px; margin-left: auto; margin-right: auto; margin-bottom: 0px; border-style: solid; border width: 2px; border-color: blue; align: center; text-align: center; padding: 30px; background-color:white} Whatever I do with the "height" specification or even remove it completely, the height of my box remains the same at the original 250px. Actually, just noticed that a few other things don't work - like the width and background-color. I change these and nothing happens; it retains the original specs.
  3. mickeymouse

    File Upload W3S Code not working

    The POST is done upon Submit because, in the called program, I print "filenm" and the path & name are there and correct. However, In the upload program, my first statement is '$target_dir = "C:/uploads/"; ' but the file doesn't get uploaded in this, I presume, temporary directory. Enough for tonight. Happy New Year and talk to you next year. Thanks
  4. mickeymouse

    File Upload W3S Code not working

    So what you are telling me is that 'fileToUpload' should be 'filenm' (which is the name attribute I used in the request to upload). I have tried that. I've tried it pure, I've tried it with single quotes, I've tried it with double quotes and I always get the same error message.
  5. mickeymouse

    File Upload W3S Code not working

    My code in request to upload is <input type='file' name='filenm' size='80'> My code in the upload program is $filenm=$_POST['filenm']; and this does give me the correct path & file name in my upload program. However I have no idea what is this "fileToUpload" in the W3S statement $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); and this "fileToUpload" is what is giving the error. If I replace "fileToUpload" with "$filenm" , i.e., $target_file = $target_dir . basename($_FILES["$filenm"]["name"]); I get error: Notice: Undefined index: C:\Users\Michael\Downloads\Pinocchio.jpg in C:\xampp\htdocs\Family Tree\FT_UploadFile.php on line 35
  6. mickeymouse

    Delete not deleting.

    OK. Found my problem. It was the asterisk "*" which I had after the word DELETE. I thought I needed the "*" to signify delete all if more than one with the same criteria. Thank you.
  7. mickeymouse

    Delete not deleting.

    $query = "DELETE * FROM names WHERE `Ref` = '$ref' "; `Ref` is field 0 in my Database and I have an item whose `Ref` is "0001" and my $ref = "0001". But my item is not getting deleted. The $AffectedRows = -1 There are no error messages. What is wrong with my $query statement? Tks
  8. My list of items are multi-words, eg., New York. "New York" is displayed but when selected only the first word is sent, in this case "New". How can I get all the words sent? (without altering my list) <select name="name"> <option value=$Row[1]>$Row[1]</option>
  9. mickeymouse

    File Upload W3S Code not working

    I want to do an image file upload. I copied the code from W3S but get errors: 1- Notice: Undefined index: fileToUpload in C:\xampp\htdocs\Family Tree\FT_UploadFile.php on line 35 2- Notice: Undefined index: fileToUpload in C:\xampp\htdocs\Family Tree\FT_UploadFile.php on line 55 (Strangely, I don't get the same error on lines 40, 55, 70 and 71 even if there is reference to "fileToUpload") 3- Sorry, only JPG, JPEG, PNG & GIF files are allowed.Sorry, your file was not uploaded. The file I'm trying to upload is definitely a "jpg" file as shown when I print the file name that was POSTed for uploading, i.e., C:\Users\Michael\Documents\PHOTOS\EASTER.jpg . Perhaps this is only due to the previous problem. The code in question is: $target_dir = "C:/xampp/htdocs/acconts/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); <---------- line 35 $uploadOk = 1; $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION)); // Check if image file is a actual image or fake image if(isset($_POST["submit"])) { $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]); <---------- line 40 if($check !== false) { echo "File is an image - " . $check["mime"] . "."; $uploadOk = 1; } else { echo "File is not an image."; $uploadOk = 0; } } // Check if file already exists if (file_exists($target_file)) { echo "Sorry, file \"$target_file\" already exists."; $uploadOk = 0; } // Check file size if ($_FILES["fileToUpload"]["size"] > 500000) { <---------- line 55 echo "Sorry, your file is too large."; $uploadOk = 0; } // Allow certain file formats if($imageFileType != "jpg" && $imageFileType != "JPG" && $imageFileType != "png" && $imageFileType != "jpeg" && $imageFileType != "JPEG" && $imageFileType != "gif" ) { echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed."; $uploadOk = 0; } // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { echo "Sorry, your file was not uploaded."; // if everything is ok, try to upload file } else { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { <---------- line 70 echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded."; <---------- line 71 } else { echo "Sorry, there was an error uploading your file."; } } Thank you.
  10. mickeymouse

    Getting data from DB -Array within Array

    OK. I got around the problem with the following code. $Child = mysql_fetch_row($Results); $SavedName[$childcnt] = $Child[1]; $SavedSex[$childcnt] = $Child[2];} print("$SavedName[$childcnt], $SavedSex[$childcnt]<br>"); (The print actually occurs later on in my code as it has to fit into a form after some other printing). Many thanks for your help.
  11. mickeymouse

    Getting data from DB -Array within Array

    I must put double quotes or printing doesn't work. e.g. Print(ABC<br>) gives me error: unexpected < I am trying to print the 1st item in the array $Child[$childcnt] I am not trying to print $childcnt. $childcnt is indeed a number. It is the nth child and it is used to define which $Child array of the many I could have and as created by the earlier code: $Child[$childcnt] = mysql_fetch_row($Results); I expect to end up with Array $Child[1] containing an Array of child info followed by Array $Child[2] containing an Array of child 2 info, and so on. Then I'm trying to print the info from each array.
  12. mickeymouse

    Getting data from DB -Array within Array

    Sorry I didn't want to bother you with all the code (now below) and sorry I didn't explain the problem properly. My problem is not with the logic but with the syntax. What happens is I get Parse error: syntax error, unexpected '[', expecting ']' If I don't have a solution to this, then I can try it as you suggest - just push results to the end. But I would prefer to have a solution to my syntax problem. Tks. $childcnt=1; $childdisp=11; $childtotal = 0; while($childcnt<10) {if($Row[$childdisp]<>"") {//================= GET CHILD ========================================= $query = "SELECT * FROM names WHERE `Ref`='$Row[$childdisp]' "; $Results = mysql_query($query, $link) or die ('Error = '. mysql_error()); $AffectedRows = mysql_affected_rows($link); if($AffectedRows < 1) {$Child[$childcnt[1]]=="$Row[$childdisp] Not in the Database."; $Child[$childcnt[2]]=="B";} else {$Child[$childcnt] = mysql_fetch_row($Results); print("$Child[$childcnt[1]] - $Child[$childcnt[2]]");} <-------SYNTAX PROBLEM???? $childcnt = $childcnt + 1; $childdisp = $childdisp + 1; $childtotal = $childtotal + 1;} else {$childcnt = 10;} }
  13. mickeymouse

    Getting data from DB -Array within Array

    After a query which is iterative depending on a variable count (like $childcnt between 1 & 10), I place the data into an array $Cild[$childcnt] But then I can't access the data within each array, Is my code not correct? $Child[$childcnt] = mysql_fetch_row($Results); print("$Child[$childcnt[1]] - $Child[$childcnt[2]]"); Tks
  14. mickeymouse

    Calling a Function

    I have this function code:function myadmin(){location.href=\"HA_AdminChoices.php\";return false;window.open(location.href); return false;} and I have this code to call the function:if ($auth=="a") {myadmin();} But I get this error message:Fatal error: Call to undefined function myadmin() Don't I have the correct way of calling a function? ThanksMickey
  15. mickeymouse

    Table Width

    Beautiful!Many thanksMickey