SitePoint Sponsor

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 55
  1. #26
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok here is the code with the errror reporting like last night i can even get to the php page i just get a white page with all errors...

    PHP Code:
    <?php
        ini_set
    ("error_reporting"E_ALL);
        
    ini_set("display_errors"1);
    ?> <?php

    require_once("conn.php");
    require_once(
    "includes.php");

    $acceptedImages = array(IMG_GIFIMG_JPGIMG_PNG);

    if(isset(
    $_POST[s1])) {

        foreach(
    $_FILES['images']['tmp_name'] as $tmpImageName) {
            if (
    file_exists($tmpImageName)) {
                
    $imgSize getimagesize($tmpImageName);


                if (
    $imgSize === false) {
                    exit(
    '<b>Your picture must be an image.</b>');
                } else if (
    $imgSize[0] > 640 || $imgSize[1] > 640) {
                    exit(
    '<b>Your image can not be larger then 640 by 640.</b>');
                } else if (!
    in_array($imgSize[2], $acceptedImages)) {
                    exit(
    '<b>You can only upload GIF, JPEG, and PNGs files.</b>');
                }
            }
        }

        
    $l count($_FILES['images']['tmp_name']);
        for (
    $i 0$i $l$i++) {

            if(
    $imgSize === false)
            {
                    
    //not an image
                    
    $error "<b>Your banner must be an image</b>";
            }
            else if (
    $imgSize[0] <= 640 || $imgSize[1] <= 640)

            {
                    
    $error "<b>For best results your image should be either 640 wide by 480 high<br>
                    or 480 wide by 640 high, no larger!</b>"
    ;
            }
            else if(
    $imgSize[2] != && $imgSize[2] != 2)
            {
                    
    $error "<b>You can upload only .gif & .jpg image files!</b>";
            }


        }
    }


    //Change end--->
            
    if(!empty($_FILES['images']['name'][0]))
            {
                    while(list(
    $key,$value) = each($_FILES['images']['name']))
                    {
                            if(!empty(
    $value))
                            {
                                    
    $NewImageName $t."_offer_".$value;
                                    
    copy($_FILES['images']['tmp_name'][$key], "re_images/".$NewImageName);

                                    
    $MyImages[] = $NewImageName;
                            }
                    }

                    if(!empty(
    $MyImages))
                    {
                            
    $ImageStr implode("|"$MyImages);

                            if(!empty(
    $_POST[OldImages]))
                            {
                                    
    $ImageStr $ImageStr."|".$_POST['OldImages'];
                            }
                    }

            }
            else
            {
                    
    $ImageStr $_POST['OldImages'];
            }

            
    $catInfo explode("|"$_POST['SelectCategory']);
            
    $CategoryID $catInfo[0];
            
    $SubcategoryID $catInfo[1];
            
    $SubcategoryName $catInfo[2];

            
    $q1 "UPDATE ds_listings set
                                            CategoryID = '
    $CategoryID',
                                            SubcategoryID = '
    $SubcategoryID',
                                            SubcategoryName = '
    $SubcategoryName',
                                            Weight = '
    $_POST[Weight]',
                                            city = '
    $_POST[city]',
                                            state = '
    $_POST[state]',
                                            oneliner = '
    $_POST[oneliner]',
                                            greeting = '
    $_POST[greeting]',
                                            description1 = '
    $_POST[description1]',
                                            Price = '
    $_POST[Price]',
                                            incall = '
    $_POST[incall]',
                                            description2 = '
    $_POST[description2]',
                                            Height = '
    $_POST[Height]',
                                            BodyType = '
    $_POST[BodyType]',
                                            Liner = '
    $_POST[Liner]',
                                            HairColor = '
    $_POST[HairColor]',
                                            EyeColor = '
    $_POST[EyeColor]',
                                            Ethnicity = '
    $_POST[Ethnicity]',
                                            UserAge = '
    $_POST[UserAge]',
                                            AttentionColor = '
    $_POST[AttentionColor]',
                                            DetailsColor = '
    $_POST[DetailsColor]',
                                            Preference = '
    $_POST[Preference]',
                                            Site = '
    $_POST[Site]',
                                            Website = '
    $_POST[Website]',
                                            Visit = '
    $_POST[Visit]',
                                            FromMonth = '
    $_POST[FromMonth]',
                                            FromDay = '
    $_POST[FromDay]',
                                            ToMonth = '
    $_POST[ToMonth]',
                                            ToDay = '
    $_POST[ToDay]',
                                            image = '
    $ImageStr'

                                            where ListingID = '
    $_GET[id]' and AgentID = '$_SESSION[AgentID]' ";

            
    mysql_query($q1);

            if(
    mysql_error())
            {
                    echo 
    mysql_error();
            }
            else
            {

            
    header("location:info.php?id=$_GET[id]");
            exit();
    }

  2. #27
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    do you want to see al the errors? There are alot of them

  3. #28
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I hit the back browser button and all the info that was previously stored in the database was deleted for that profile

  4. #29
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You didn't post the errors, so no, I don't see 'em.

    What's the point of the second for loop? The one that begins
    PHP Code:
        $l count($_FILES['images']['tmp_name']);
        for (
    $i 0$i $l$i++) { 
    It looks like it's trying (and terribly terribly failing) to repeat what the foreach loop above it is doing.
    PHP questions? RTFM
    MySQL questions? RTFM

  5. #30
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kromey
    You didn't post the errors, so no, I don't see 'em.

    What's the point of the second for loop? The one that begins
    PHP Code:
        $l count($_FILES['images']['tmp_name']);
        for (
    $i 0$i $l$i++) { 
    It looks like it's trying (and terribly terribly failing) to repeat what the foreach loop above it is doing.
    do i delete that line?

    error messages...

    Warning: Cannot send session cache limiter - headers already sent (output started at c:\apache\htdocs\floridafinecars\edit.php:4) in c:\apache\htdocs\floridafinecars\conn.php on line 32

    Warning: Undefined variable: Categories in c:\apache\htdocs\floridafinecars\includes.php on line 54

    Warning: Use of undefined constant AgentID - assumed 'AgentID' in c:\apache\htdocs\floridafinecars\includes.php on line 70

    Warning: Use of undefined constant AccountType - assumed 'AccountType' in c:\apache\htdocs\floridafinecars\includes.php on line 76

    Warning: Undefined variable: greeting in c:\apache\htdocs\floridafinecars\includes.php on line 93

    Warning: Use of undefined constant AgentID - assumed 'AgentID' in c:\apache\htdocs\floridafinecars\includes.php on line 100

    Warning: Use of undefined constant AccountType - assumed 'AccountType' in c:\apache\htdocs\floridafinecars\includes.php on line 106

    Warning: Use of undefined constant AgentID - assumed 'AgentID' in c:\apache\htdocs\floridafinecars\includes.php on line 129

    Warning: Use of undefined constant AccountType - assumed 'AccountType' in c:\apache\htdocs\floridafinecars\includes.php on line 135

    Warning: Use of undefined constant AccountExpireDate - assumed 'AccountExpireDate' in c:\apache\htdocs\floridafinecars\includes.php on line 142

    Warning: Use of undefined constant AccountExpireDate - assumed 'AccountExpireDate' in c:\apache\htdocs\floridafinecars\includes.php on line 144

    Warning: Undefined variable: RenewAccount in c:\apache\htdocs\floridafinecars\includes.php on line 151

    Warning: Use of undefined constant m - assumed 'm' in c:\apache\htdocs\floridafinecars\includes.php on line 164

    Warning: Use of undefined constant d - assumed 'd' in c:\apache\htdocs\floridafinecars\includes.php on line 164

    Warning: Use of undefined constant Y - assumed 'Y' in c:\apache\htdocs\floridafinecars\includes.php on line 164

    Warning: Use of undefined constant m - assumed 'm' in c:\apache\htdocs\floridafinecars\includes.php on line 165

    Warning: Use of undefined constant d - assumed 'd' in c:\apache\htdocs\floridafinecars\includes.php on line 165

    Warning: Use of undefined constant Y - assumed 'Y' in c:\apache\htdocs\floridafinecars\includes.php on line 165

    Warning: Use of undefined constant m - assumed 'm' in c:\apache\htdocs\floridafinecars\includes.php on line 194

    Warning: Use of undefined constant d - assumed 'd' in c:\apache\htdocs\floridafinecars\includes.php on line 194

    Warning: Use of undefined constant Y - assumed 'Y' in c:\apache\htdocs\floridafinecars\includes.php on line 194

    Warning: Use of undefined constant m - assumed 'm' in c:\apache\htdocs\floridafinecars\includes.php on line 195

    Warning: Use of undefined constant d - assumed 'd' in c:\apache\htdocs\floridafinecars\includes.php on line 195

    Warning: Use of undefined constant Y - assumed 'Y' in c:\apache\htdocs\floridafinecars\includes.php on line 195

    Warning: Use of undefined constant m - assumed 'm' in c:\apache\htdocs\floridafinecars\includes.php on line 224

    Warning: Use of undefined constant d - assumed 'd' in c:\apache\htdocs\floridafinecars\includes.php on line 224

    Warning: Use of undefined constant Y - assumed 'Y' in c:\apache\htdocs\floridafinecars\includes.php on line 224

    Warning: Use of undefined constant m - assumed 'm' in c:\apache\htdocs\floridafinecars\includes.php on line 225

    Warning: Use of undefined constant d - assumed 'd' in c:\apache\htdocs\floridafinecars\includes.php on line 225

    Warning: Use of undefined constant Y - assumed 'Y' in c:\apache\htdocs\floridafinecars\includes.php on line 225

    Warning: Use of undefined constant IMG_GIF - assumed 'IMG_GIF' in c:\apache\htdocs\floridafinecars\edit.php on line 9

    Warning: Use of undefined constant IMG_JPG - assumed 'IMG_JPG' in c:\apache\htdocs\floridafinecars\edit.php on line 9

    Warning: Use of undefined constant IMG_PNG - assumed 'IMG_PNG' in c:\apache\htdocs\floridafinecars\edit.php on line 9

    Warning: Use of undefined constant s1 - assumed 's1' in c:\apache\htdocs\floridafinecars\edit.php on line 11

    Warning: Undefined index: OldImages in c:\apache\htdocs\floridafinecars\edit.php on line 79

    Warning: Undefined index: SelectCategory in c:\apache\htdocs\floridafinecars\edit.php on line 82

    Warning: Undefined offset: 1 in c:\apache\htdocs\floridafinecars\edit.php on line 84

    Warning: Undefined offset: 2 in c:\apache\htdocs\floridafinecars\edit.php on line 85

    Warning: Undefined index: Weight in c:\apache\htdocs\floridafinecars\edit.php on line 91

    Warning: Undefined index: city in c:\apache\htdocs\floridafinecars\edit.php on line 92

    Warning: Undefined index: state in c:\apache\htdocs\floridafinecars\edit.php on line 93

    Warning: Undefined index: oneliner in c:\apache\htdocs\floridafinecars\edit.php on line 94

    Warning: Undefined index: greeting in c:\apache\htdocs\floridafinecars\edit.php on line 95

    Warning: Undefined index: description1 in c:\apache\htdocs\floridafinecars\edit.php on line 96

    Warning: Undefined index: Price in c:\apache\htdocs\floridafinecars\edit.php on line 97

    Warning: Undefined index: incall in c:\apache\htdocs\floridafinecars\edit.php on line 98

    Warning: Undefined index: description2 in c:\apache\htdocs\floridafinecars\edit.php on line 99

    Warning: Undefined index: Height in c:\apache\htdocs\floridafinecars\edit.php on line 100

    Warning: Undefined index: BodyType in c:\apache\htdocs\floridafinecars\edit.php on line 101

    Warning: Undefined index: Liner in c:\apache\htdocs\floridafinecars\edit.php on line 102

    Warning: Undefined index: HairColor in c:\apache\htdocs\floridafinecars\edit.php on line 103

    Warning: Undefined index: EyeColor in c:\apache\htdocs\floridafinecars\edit.php on line 104

    Warning: Undefined index: Ethnicity in c:\apache\htdocs\floridafinecars\edit.php on line 105

    Warning: Undefined index: UserAge in c:\apache\htdocs\floridafinecars\edit.php on line 106

    Warning: Undefined index: AttentionColor in c:\apache\htdocs\floridafinecars\edit.php on line 107

    Warning: Undefined index: DetailsColor in c:\apache\htdocs\floridafinecars\edit.php on line 108

    Warning: Undefined index: Preference in c:\apache\htdocs\floridafinecars\edit.php on line 109

    Warning: Undefined index: Site in c:\apache\htdocs\floridafinecars\edit.php on line 110

    Warning: Undefined index: Website in c:\apache\htdocs\floridafinecars\edit.php on line 111

    Warning: Undefined index: Visit in c:\apache\htdocs\floridafinecars\edit.php on line 112

    Warning: Undefined index: FromMonth in c:\apache\htdocs\floridafinecars\edit.php on line 113

    Warning: Undefined index: FromDay in c:\apache\htdocs\floridafinecars\edit.php on line 114

    Warning: Undefined index: ToMonth in c:\apache\htdocs\floridafinecars\edit.php on line 115

    Warning: Undefined index: ToDay in c:\apache\htdocs\floridafinecars\edit.php on line 116

    Warning: Cannot add header information - headers already sent by (output started at c:\apache\htdocs\floridafinecars\edit.php:4) in c:\apache\htdocs\floridafinecars\edit.php on line 130

  6. #31
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, I'm trying to be patient and understanding, but it's been a long day, I'm tired and grumpy, so I apologize if the following is overly gruff:

    You must quote all non-numerical array indexes! Things like $_POST[s1] are incorrect syntax!! You must use quotes, like so: $_POST['s1']. Go back through every line of code and fix every one of those errors, and you'll get rid of all the "undefined constant" warnings you see. We went over this last night, and I've already mentioned it at least once tonight, and I really am getting a little tired of repeating myself.
    PHP questions? RTFM
    MySQL questions? RTFM

  7. #32
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok i will start now it is going to take me some time to do every page but if you say i should I will I just have one question on a these

    PHP Code:
            $q1 "UPDATE discreet_listings set
                                            CategoryID = '
    $CategoryID',
                                            SubcategoryID = '
    $SubcategoryID',
                                            SubcategoryName = '
    $SubcategoryName',
                                            Weight = '
    $_POST[Weight]',
                                            city = '
    $_POST[city]',
                                            state = '
    $_POST[state]',
                                            oneliner = '
    $_POST[oneliner]',
                                            greeting = '
    $_POST[greeting]',
                                            description1 = '
    $_POST[description1]',
                                            Price = '
    $_POST[Price]',
                                            incall = '
    $_POST[incall]',
                                            description2 = '
    $_POST[description2]',
                                            Height = '
    $_POST[Height]',
                                            BodyType = '
    $_POST[BodyType]',
                                            Liner = '
    $_POST[Liner]',
                                            HairColor = '
    $_POST[HairColor]',
                                            EyeColor = '
    $_POST[EyeColor]',
                                            Ethnicity = '
    $_POST[Ethnicity]',
                                            UserAge = '
    $_POST[UserAge]',
                                            AttentionColor = '
    $_POST[AttentionColor]',
                                            DetailsColor = '
    $_POST[DetailsColor]',
                                            Preference = '
    $_POST[Preference]',
                                            Site = '
    $_POST[Site]',
                                            Website = '
    $_POST[Website]',
                                            Visit = '
    $_POST[Visit]',
                                            FromMonth = '
    $_POST[FromMonth]',
                                            FromDay = '
    $_POST[FromDay]',
                                            ToMonth = '
    $_POST[ToMonth]',
                                            ToDay = '
    $_POST[ToDay]',
                                            image = '
    $ImageStr
    would i change them to this:
    ToMonth = '$_POST['ToMonth']',
    or this:
    ToMonth = "$_POST['ToMonth']",

  8. #33
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ToMonth = '$_POST['ToMonth']'

    PHP should properly expand that variable before sending it to your database. If not, add curly braces around each one (ToMonth = '{$_POST['ToMonth']}'). Also, you really should be validating your user input before you enter it into the database. Refer to mysql_real_escape_string.
    PHP questions? RTFM
    MySQL questions? RTFM

  9. #34
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    netfreakz, i told you the answer to that question yesterday. pay attention.

  10. #35
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $SelectCategory .= "<option value=\"$a1['CategoryID']|$a2['SubcategoryID']|$a2['SubcategoryName']\">$a2[SubcategoryName]</option>\n"

    is this right i am getting an error and dont know how to fix it.. Sorry I am not trying to piss you off.

  11. #36
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "I am getting an error" is not very helpful to someone who wants to help you.
    "This is the error I am getting: ...." is much more useful.
    PHP questions? RTFM
    MySQL questions? RTFM

  12. #37
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok I only have undifined variables now. Do i have to fix them or no because a variable can change?

  13. #38
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Strictly speaking, you don't have to fix them, provided that they are not causing your application to behave in undesirable ways. However, I would very strongly recommend that you do fix them, especially since your application is not working correctly. Who knows, maybe one (or more) of these undefined variables is the cause, and fixing that would magically make the whole thing work beautifully.
    PHP questions? RTFM
    MySQL questions? RTFM

  14. #39
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kromey
    Strictly speaking, you don't have to fix them, provided that they are not causing your application to behave in undesirable ways. However, I would very strongly recommend that you do fix them, especially since your application is not working correctly. Who knows, maybe one (or more) of these undefined variables is the cause, and fixing that would magically make the whole thing work beautifully.
    Do I fix it the same way as i fixed the undefined constant?

  15. #40
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    here are all my errors i now get

    Warning: Undefined variable: Categories in c:\apache\htdocs\floridafinecars\includes.php on line 54

    Warning: Undefined variable: greeting in c:\apache\htdocs\floridafinecars\includes.php on line 93

    Warning: Undefined variable: RenewAccount in c:\apache\htdocs\floridafinecars\includes.php on line 151

    Warning: Undefined index: OldImages in c:\apache\htdocs\floridafinecars\edit.php on line 80

    Warning: Undefined index: SelectCategory in c:\apache\htdocs\floridafinecars\edit.php on line 83

    Warning: Undefined offset: 1 in c:\apache\htdocs\floridafinecars\edit.php on line 85

    Warning: Undefined offset: 2 in c:\apache\htdocs\floridafinecars\edit.php on line 86

    Warning: Undefined index: Weight in c:\apache\htdocs\floridafinecars\edit.php on line 92

    Warning: Undefined index: city in c:\apache\htdocs\floridafinecars\edit.php on line 93

    Warning: Undefined index: state in c:\apache\htdocs\floridafinecars\edit.php on line 94

    Warning: Undefined index: oneliner in c:\apache\htdocs\floridafinecars\edit.php on line 95

    Warning: Undefined index: greeting in c:\apache\htdocs\floridafinecars\edit.php on line 96

    Warning: Undefined index: description1 in c:\apache\htdocs\floridafinecars\edit.php on line 97

    Warning: Undefined index: Price in c:\apache\htdocs\floridafinecars\edit.php on line 98

    Warning: Undefined index: incall in c:\apache\htdocs\floridafinecars\edit.php on line 99

    Warning: Undefined index: description2 in c:\apache\htdocs\floridafinecars\edit.php on line 100

    Warning: Undefined index: Height in c:\apache\htdocs\floridafinecars\edit.php on line 101

    Warning: Undefined index: BodyType in c:\apache\htdocs\floridafinecars\edit.php on line 102

    Warning: Undefined index: Liner in c:\apache\htdocs\floridafinecars\edit.php on line 103

    Warning: Undefined index: HairColor in c:\apache\htdocs\floridafinecars\edit.php on line 104

    Warning: Undefined index: EyeColor in c:\apache\htdocs\floridafinecars\edit.php on line 105

    Warning: Undefined index: Ethnicity in c:\apache\htdocs\floridafinecars\edit.php on line 106

    Warning: Undefined index: UserAge in c:\apache\htdocs\floridafinecars\edit.php on line 107

    Warning: Undefined index: AttentionColor in c:\apache\htdocs\floridafinecars\edit.php on line 108

    Warning: Undefined index: DetailsColor in c:\apache\htdocs\floridafinecars\edit.php on line 109

    Warning: Undefined index: Preference in c:\apache\htdocs\floridafinecars\edit.php on line 110

    Warning: Undefined index: Site in c:\apache\htdocs\floridafinecars\edit.php on line 111

    Warning: Undefined index: Website in c:\apache\htdocs\floridafinecars\edit.php on line 112

    Warning: Undefined index: Visit in c:\apache\htdocs\floridafinecars\edit.php on line 113

    Warning: Undefined index: FromMonth in c:\apache\htdocs\floridafinecars\edit.php on line 114

    Warning: Undefined index: FromDay in c:\apache\htdocs\floridafinecars\edit.php on line 115

    Warning: Undefined index: ToMonth in c:\apache\htdocs\floridafinecars\edit.php on line 116

    Warning: Undefined index: ToDay in c:\apache\htdocs\floridafinecars\edit.php on line 117
    You have an error in your SQL syntax near '(Weight = ''), (city = ''), ' at line 5
    Warning: Undefined variable: mi in c:\apache\htdocs\floridafinecars\edit.php on line 379

    Warning: Undefined variable: mi in c:\apache\htdocs\floridafinecars\edit.php on line 379

    Warning: Undefined variable: mi in c:\apache\htdocs\floridafinecars\edit.php on line 379

    Warning: Undefined variable: mi in c:\apache\htdocs\floridafinecars\edit.php on line 379

    Warning: Undefined variable: mi in c:\apache\htdocs\floridafinecars\edit.php on line 379

    Warning: Undefined variable: mi in c:\apache\htdocs\floridafinecars\edit.php on line 379

    Warning: Undefined variable: mi in c:\apache\htdocs\floridafinecars\edit.php on line 379


    Warning: Undefined variable: FullBanner in c:\apache\htdocs\floridafinecars\ShowBanner2.php on line 26

  16. #41
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I appreciate this I am going to fix every error till I get none. This site has taken me a long time to build. I want it to be perfect and i am learning. Thanks for your help.

  17. #42
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, you fix "undefined variable" warnings by defining the variables before you use them, i.e., you give each and every variable a value before you try to reference that value.
    PHP questions? RTFM
    MySQL questions? RTFM

  18. #43
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok i know you had a long day and i am not trying to get on your last nerve but i am confused.

  19. #44
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also what about undefined index and offset?

  20. #45
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "Undefined variable" means that you are trying to do something with the value of a variable to which you have not assigned a value.
    PHP Code:
    <?php
        
    //the following doesn't make any sense,
        // because $var is not defined
        
    if($var == 5)
            
    do_something($var);
    ?>
    PHP Code:
    <?php
        
    //the following makes sense
        // because I define $var first
        
    $var 3;
        if(
    $var == 5)
            
    do_something($var);
    ?>
    In PHP, undefined variables are not syntax errors (hence why you see warnings instead of errors) because of its loosely-typed nature. However, undefined variables usually are indicative of an error in your app's logic, and thus should be fixed.

    Undefined index and undefined offset are the same kind of things, but refer specifically to array indexes to which no value has been assigned.
    PHP questions? RTFM
    MySQL questions? RTFM

  21. #46
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok should and if so how would i fix the undefined index and offset? That sounds complicated to me...

  22. #47
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The same way you'd fix the undefined variable warnings - assign a value before you try to reference that value.
    PHP questions? RTFM
    MySQL questions? RTFM

  23. #48
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I will fix all of my pages for undefined constants, variables, index and offset over the next few days and nights. It will take me some time the site has alot of pages but I will get it done. Thank you for pointing it out to me.
    Do you think you can help me fix the get image size?

  24. #49
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fix all the undefined variables, indexes, and offsets first, as those could be causing us problems.
    PHP questions? RTFM
    MySQL questions? RTFM

  25. #50
    SitePoint Addict
    Join Date
    Jan 2006
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok first I have a sql syntax error i can seem to figure out it reads:
    You have an error in your SQL syntax near '(Weight = '80-90 Lbs'), (city = 'farmingville'' at line 5

    PHP Code:
            $q1 "UPDATE d_s_listings set
                                            CategoryID = '
    $CategoryID',
                                            SubcategoryID = '
    $SubcategoryID',
                                            SubcategoryName = '
    $SubcategoryName',
                                            (Weight = '
    {$_POST['Weight']}'),
                                            (city = '
    {$_POST['city']}'),
                                            (state = '
    {$_POST['state']}'),
                                            (oneliner = '
    {$_POST['oneliner']}'),
                                            (greeting = '
    {$_POST['greeting']}'),
                                            (description1 = '
    {$_POST['description1']}'),
                                            (Price = '
    {$_POST['Price']}'),
                                            (incall = '
    {$_POST['incall']}'),
                                            (description2 = '
    {$_POST['description2']}'),
                                            (Height = '
    {$_POST['Height']}'),
                                            (BodyType = '
    {$_POST['BodyType']}'),
                                            (Liner = '
    {$_POST['Liner']}'),
                                            (HairColor = '
    {$_POST['HairColor']}'),
                                            (EyeColor = '
    {$_POST['EyeColor']}'),
                                            (Ethnicity = '
    {$_POST['Ethnicity']}'),
                                            (UserAge = '
    {$_POST['UserAge']}'),
                                            (AttentionColor = '
    {$_POST['AttentionColor']}'),
                                            (DetailsColor = '
    {$_POST['DetailsColor']}'),
                                            (Preference = '
    {$_POST['Preference']}'),
                                            (Site = '
    {$_POST['Site']}'),
                                            (Website = '
    {$_POST['Website']}'),
                                            (Visit = '
    {$_POST['Visit']}'),
                                            (FromMonth = '
    {$_POST['FromMonth']}'),
                                            (FromDay = '
    {$_POST['FromDay']}'),
                                            (ToMonth = '
    {$_POST['ToMonth']}'),
                                            (ToDay = '
    {$_POST['ToDay']}'),
                                            image = '
    $ImageStr'
                                            where ListingID = '
    {$_GET['id']}' and AgentID = '{$_SESSION['AgentID']}' ";

            
    mysql_query($q1);

            if(
    mysql_error())
            {
                    echo 
    mysql_error();
            }
            else
            {

            
    header("location:info.php?id=$_GET[id]");
            exit();



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •