Jump to content

litebearer

Members
  • Posts

    2,356
  • Joined

  • Last visited

Posts posted by litebearer

  1. If you use OR the test will fail - ie if one is good and one is bad, OR both are bad , it will produce fail

     

    If you use AND then both conditions must be bad for it to produce fail

     

    Soooo.

    if($a !== $b AND $a !== $c) {then do something }else{do something else}

  2. updating is a simple a populating a form using the data from the data base.

     

    experiment...

    1. get and display data for a particular user

    2. echo the values into the "value" of the appropriate form field

     

    search google for "php mysql UPDATE tutorial"

     

    when you get stuck on a particular part come back and show us what you tried and what errors you received.

  3. Psuedo code...

     

    $content = place some text into a variable

     

    $array01 = explode(" ", $content) --- explode your variable into an array using the SPACE as the separator

     

    $count = count($array01) --- count the number of elements in the array

     

    if($count<=50) {

    $teaser = $content --- if 50 or less then you can use the $content as your 'teaser'

    }ELSE{

    $array02 = array_splice($array01, 0, 50) --- if greater than 50; use array_splice to place the first 50 elements into a new array.

     

    $teaser = implode(" ", $array02) --- Then use implode to create your 'teaser'; using the SPACE as the separator.

    }

  4. A quick look seems to indicate the problem can be found in these four lines...

    $tmp = imagecreatetruecolor($max_width,$file_height_new);
    imagecopyresampled($tmp,$src,0,0,0,0,$max_width,$file_height_new,$width,$height);
    imagejpeg($tmp,$upload_dir . $file_new,100);
    if(move_uploaded_file($file_tmp, $upload_dir . $file_new)){
    

     

    it appears that you are saving the resized image,  then overwriting it with the original.

  5. My suggestion is to start small ie create a simple test file using the tutorial provided above to see how to upload a file. Once you do that you will see how to change your actual scripts.

     

    Most new phpers try to do too many things at once. build your scripts in increments. Makes life sooooo much easier when trying to debug.

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