SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 36
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Location
    British Columbia, Canada
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Form built with DW form wizard doesn't work

    I'm still struggling trying to get my forms to behave. I thought I had it solved with the offlist help of one of the form members but even the form which worked with his help is now broken. I've started from scratch, using the DW form wizard and not touching it AT ALL, just uploading it to the server and filling it out. When I hit send I get the same CGI error as before. When I look in the url bar the name of the form has been duplicated. When I view the source code, sure enough, the name of the form is duplicated.

    As far as I can figure (with the help of our server tech support) this is the offending code - generated by DW!! - and I think it's the first 3 lines which are causing the problem:


    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
    $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }

    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
    $insertSQL = sprintf("INSERT INTO groomers (shopName, groomPropName, groomStreet, groomCity, groomProvince, groomCountry, groomPhone, groomEmail, groomWebsite, groomListing, groomPic, groomShow_Hide) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
    GetSQLValueString($_POST['shopName'], "text"),
    GetSQLValueString($_POST['groomPropName'], "text"),
    GetSQLValueString($_POST['groomStreet'], "text"),
    GetSQLValueString($_POST['groomCity'], "text"),
    GetSQLValueString($_POST['groomProvince'], "text"),
    GetSQLValueString($_POST['groomCountry'], "text"),
    GetSQLValueString($_POST['groomPhone'], "text"),
    GetSQLValueString($_POST['groomEmail'], "text"),
    GetSQLValueString($_POST['groomWebsite'], "text"),
    GetSQLValueString($_POST['groomListing'], "text"),
    GetSQLValueString($_POST['groomPic'], "text"),
    GetSQLValueString($_POST['groomShow_Hide'], "text"));

    mysql_select_db($database_db9568, $db9568);
    $Result1 = mysql_query($insertSQL, $db9568) or die(mysql_error());

    $insertGoTo = "CRcart/directory_list_logo.php";
    if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
    }
    header(sprintf("Location: %s", $insertGoTo));

    Why on earth would a DW wizard generate code which throws up a CGI error?! The exact error is: CGI Error - The specified CGI application misbehaved by not returning a complete set of HTTP headers.

    In case it helps, this is the form action line: <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">

  2. #2
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Location
    Florida
    Posts
    58
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The first thre lines are just setting the path of the document your posting to, in this case it self, a whole lot of code to submit to itself if you ask me. Your problem sounds more like the differnece between cgi php, and cli php. Yes the are different and they behave very differently.

    cgi is typically used in production servers

    DW will always over inflate your code (try aptana)


    as far as your code with out more i couldnt be certain but try


    $editFormAction = $_SERVER['PHP_SELF'];

    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
    $insertSQL = sprintf("INSERT INTO groomers (shopName, groomPropName, groomStreet, groomCity, groomProvince, groomCountry, groomPhone, groomEmail, groomWebsite, groomListing, groomPic, groomShow_Hide) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
    GetSQLValueString($_POST['shopName'], "text"),
    GetSQLValueString($_POST['groomPropName'], "text"),
    GetSQLValueString($_POST['groomStreet'], "text"),
    GetSQLValueString($_POST['groomCity'], "text"),
    GetSQLValueString($_POST['groomProvince'], "text"),
    GetSQLValueString($_POST['groomCountry'], "text"),
    GetSQLValueString($_POST['groomPhone'], "text"),
    GetSQLValueString($_POST['groomEmail'], "text"),
    GetSQLValueString($_POST['groomWebsite'], "text"),
    GetSQLValueString($_POST['groomListing'], "text"),
    GetSQLValueString($_POST['groomPic'], "text"),
    GetSQLValueString($_POST['groomShow_Hide'], "text"));

    mysql_select_db($database_db9568, $db9568);
    $Result1 = mysql_query($insertSQL, $db9568) or die(mysql_error());

    $insertGoTo = "CRcart/directory_list_logo.php";
    if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
    }
    header(sprintf("Location: %s", $insertGoTo));

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Location
    Florida
    Posts
    58
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    This is a little odd to me:

    $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);

    why add url vars to the form action and then get them from post too?

    it just seems like a pretty dumb thing to do when you know what values your expecting

  4. #4
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Location
    Florida
    Posts
    58
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    lol wtf is?

    header(sprintf("Location: %s", $insertGoTo)); you can an sql query from the header?

  5. #5
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Hi, I have added some quotes into the code to explain what does what and why.
    DW is an OK tool but can over complicate things!

    Code:
    <?php
    
    
    /* This sets the form's action, where it is directing the form data too
     * in this case - its back to itself $_SERVER['PHP_SELF']
     **/
    $editFormAction = $_SERVER['PHP_SELF'];
    
    
    /* Checks the incoming url to see if any query string has been passed to it.
     * eg: www.mysite.com/action.php?name=Spike 
     * anything after the ? is the query string
     * this is taken and added to the form action IN CASE IT IS NEEDED LATER
     **/
    if (isset($_SERVER['QUERY_STRING'])) {
    $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }
    
    
    /* if the form has been sent, check for the MM_insert field
     * (Should be in the <form> and a <hidden> field
     */
    
    
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
    
    
    /* run the query using a FORMATTED string
     * GetSQLValueString is a DW created function that checks the value being sent to it
     * and gets rid of any nasties
     **/
    $insertSQL = sprintf("INSERT INTO groomers (shopName, groomPropName, groomStreet, groomCity, groomProvince, groomCountry, groomPhone, groomEmail, groomWebsite, groomListing, groomPic, groomShow_Hide) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
    GetSQLValueString($_POST['shopName'], "text"),
    GetSQLValueString($_POST['groomPropName'], "text"),
    GetSQLValueString($_POST['groomStreet'], "text"),
    GetSQLValueString($_POST['groomCity'], "text"),
    GetSQLValueString($_POST['groomProvince'], "text"),
    GetSQLValueString($_POST['groomCountry'], "text"),
    GetSQLValueString($_POST['groomPhone'], "text"),
    GetSQLValueString($_POST['groomEmail'], "text"),
    GetSQLValueString($_POST['groomWebsite'], "text"),
    GetSQLValueString($_POST['groomListing'], "text"),
    GetSQLValueString($_POST['groomPic'], "text"),
    GetSQLValueString($_POST['groomShow_Hide'], "text"));
    
    
    /* select the datatbase */
    mysql_select_db($database_db9568, $db9568);
    
    
    /* run the query */
    $Result1 = mysql_query($insertSQL, $db9568) or die(mysql_error());
    
    
    /* where to go to AFTER the query has been run */
    $insertGoTo = "CRcart/directory_list_logo.php";
    
    
    /* as before with the query string. If it exists, append it to the $insertToGo variable
     * So if your page was 
     * www.mysite.com/action.php?name=Spike 
     * and the next page the script is going to is
     * CRcart/directory_list_logo.php
     * it would become 
     * CRcart/directory_list_logo.php?name=Spike
     * If you are not worried about appending query strings - you can safely delete the following threee lines.
     **/
     
    if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
    }
    
    
    /* redirect the user based on the variable created above.
     **/
    header(sprintf("Location: %s", $insertGoTo));
    
    
    /* this could also be acheived by simply using:
    
    
    header("Location: CRcart/directory_list_logo.php");
    exit();
    
    
    */
    
    
    ?>
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  6. #6
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Location
    Florida
    Posts
    58
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    HA!
    I seriously always thought sprintf was an inno db query string, and my use of inno db is limited considering I mostly develop on unix. I do use inno for certain application and or table structures but only when its required. Thats my first encounter with concentating strings using sprintf.

    reading http://php.net/manual/en/function.sprintf.php it looks like more php shortcode and i don't really see much benefeit in adding yet another syntax into the library. I'll wait on that one until it becomes an issue

  7. #7
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Location
    British Columbia, Canada
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by spikeZ View Post
    Hi, I have added some quotes into the code to explain what does what and why.
    DW is an OK tool but can over complicate things!
    So I'm learning! I am VERY new to working with php - only 3-4 weeks - so am afraid to fiddle with things too much. That's why when the lynda.com tutorial told me to use the Form Wizard I figured that would be the way to go.

    Quote Originally Posted by spikeZ View Post
    /* Checks the incoming url to see if any query string has been passed to it.
    * eg: www.mysite.com/action.php?name=Spike
    * anything after the ? is the query string
    * this is taken and added to the form action IN CASE IT IS NEEDED LATER
    **/
    So that would be if I wanted it to carry some information forward to another form? That type of thing?

    Quote Originally Posted by spikeZ View Post
    /* if the form has been sent, check for the MM_insert field
    * (Should be in the <form> and a <hidden> field
    That actually reminds me of another question I have but I won't complicate this thread with that one! :>)

    Quote Originally Posted by spikeZ View Post
    * GetSQLValueString is a DW created function that checks the value being sent to it
    * and gets rid of any nasties
    What do you mean by "nasties"? :>)

    Quote Originally Posted by spikeZ View Post
    * If you are not worried about appending query strings - you can safely delete the following threee lines.
    I'm pretty sure I'm not appending any query strings but as I said above, I'm so new to this I'm not really sure. :>)

    Quote Originally Posted by spikeZ View Post
    /* redirect the user based on the variable created above.
    **/
    header(sprintf("Location: %s", $insertGoTo));

    /* this could also be acheived by simply using:

    header("Location: CRcart/directory_list_logo.php");
    exit();
    Thanks for all that spikeZ - much appreciated. I *think* I understand most of it. :>) Do you think that removing the 3 lines you mention above would solve my problem - where the form is doubling the path name? That seems to be what is messing the whole thing up.

    Thanks also to JamesKenny for all your comments. Do either of you know a *better* way for a newbie to build a record insertion form than using the DW wizard? I did look at the DW5 manual pdf but I've never had much luck with Adobe's manuals - they aren't simple enough for a beginner. I do have years of html coding behind me but the php stuff has thrown me for a loop. Is there a REALLY SIMPLE, step by step tutorial online anywhere that I could use to start from scratch to build a form like this?

  8. #8
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Location
    British Columbia, Canada
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A few minutes later ... I removed the 3 lines you suggested and changed the header(sprintf... line to your suggested header line and the same thing happens: the form throws up the cgi error and the url it's trying to go to is still http://caninereview.ca/directory_gro...omer_form.php?

    What on EARTH is making it duplicate the page like that? Aside from the fact that it's not supposed to go back to itself, it's supposed to go to CRcart/directory_list_logo.php.

    This is SO frustrating. What makes it worse is that all the forms were working just fine before I asked the server people to activate ZendFramework. I originally thought it was using ZendMail which broke the form but obviously that wasn't the problem because this form isn't using ANY kind of e-mail commands. It's just a bare bones "let's see if this works first before adding to it" form. (It was the same lynda.com tutorial which told me to use ZendFramework, by the way, and I didn't know at that time about using the mail() coding in php.)

    Do you think I should ask the server people to DE-activate Zend Framework to see if the forms go back to working?

  9. #9
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Location
    British Columbia, Canada
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A few minutes even later. :>) I bit the bullet and tried building a rudimentary (2 fields) form using the manual pdf. DW generated EXACTLY the same code as it did with the Wizard (don't ask why I thought it might be different - I don't know! <LOL>) and the form produced exactly the same result.

    I guess I do need a tutorial from somewhere other than DW. JamesKenny - what is aptana?

  10. #10
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Location
    British Columbia, Canada
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK - I found a tutorial for building a form and inserting the content into the db. It works but with a glitch. The tutorial has me build the form on a page by itself, with the form action set to go to an insert.php page. Then the insert.php page is all php coding and works just fine, even sending me an e-mail upon inserting the record.

    The glitch is that it inserts TWO records into the database, not just one. The first record is completely blank and the second contains the form contents. Now I can go in and delete all the blank records but that could become a pain in the you-know-what, so hopefully someone can tell me what's causing that. :>) Here's all the code on the insert.php page (I've incorporated some of spikeZ's suggestions from earlier):

    <?php
    $con = mysql_connect("***","****","****");
    if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }

    mysql_select_db("*****", $con);

    $sql="INSERT INTO groomers (shopName, groomPropName, groomStreet, groomCity, groomProvince, groomCountry, groomPhone, groomEmail, groomWebsite, groomListing)
    VALUES
    ('$_POST[shopName]','$_POST[groomPropName]','$_POST[groomStreet]','$_POST[groomCity]','$_POST[groomProvince]','$_POST[groomCountry]','$_POST[groomPhone]','$_POST[groomEmail]','$_POST[groomWebsite]','$_POST[groomListing]')";

    if (!mysql_query($sql,$con))
    {
    die('Error: ' . mysql_error());
    }

    $to = "webmaster@caninereview.ca";
    $subject = "New listing in groomers directory";
    $message = "There's a new listing for " . $_POST['shopName'];
    $from = $_POST['groomEmail'];
    $headers = "From:" . $from;
    mail($to,$subject,$message,$headers);

    header("Location: CRcart/directory_list_logo.php");
    exit();

    mysql_close($con)
    ?>
    Last edited by spikeZ; Mar 1, 2012 at 16:00.

  11. #11
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Hi Helen and awesome effort on the learning, very refreshing to see people willing to have a go!

    OK, to address some of the things you brought up earlier.

    Quote Originally Posted by helen
    So that would be if I wanted it to carry some information forward to another form? That type of thing?
    Yes but its so rare that you would want to do it that way but DW chucks it in there anyway!

    Quote Originally Posted by helen
    That actually reminds me of another question I have but I won't complicate this thread with that one! :>)
    fire away

    Quote Originally Posted by helen
    What do you mean by "nasties"? :>)
    Unfortunately not everyone wants to play by the rules and can easily manipulate your form to delete your entire database
    Scary and sadly true. Look up "MySQL Injection".
    In your script I have added the value mysql_real_escape_string($value) which helps strip out any basic attempts to alter the query using POST'ed values.


    Now, your new script.

    You want to check if the POST form has been sent before processing. If nothing has been sent then script will run anyway and insert blank lines which is what you are getting.
    This is why DW adds the MM_insert field to the form and then checks for that value in the script before doing anything else.

    Once the form has been sent, you need to take the POST values and assign them to basic variables. Then you dont use the user submitted data and can run all manner of cleaning and sanitizing functions over it before saving it in your database.

    Code:
    
    if(isset($_POST['hidden_value'])) {
        $shopname = mysql_real_escape_string($_POST['shopName']);
        $groomPropName = mysql_real_escape_string($_POST['groomPropName']);
        $groomStreet = mysql_real_escape_string($_POST['groomStreet']);
        $groomCity = mysql_real_escape_string($_POST['groomCity']);
        $groomProvince = mysql_real_escape_string($_POST['groomProvince']);
        $groomCountry = mysql_real_escape_string($_POST['groomCountry']);
        $groomPhone = mysql_real_escape_string($_POST['groomPhone']);
        $groomEmail = mysql_real_escape_string($_POST['groomEmail']);
        $groomWebsite = mysql_real_escape_string($_POST['groomWebsite']);
        $groomListing = mysql_real_escape_string($_POST['groomListing']);
            
        $sql="
            INSERT INTO
                groomers (
              shopName
            , groomPropName
            , groomStreet
            , groomCity
            , groomProvince
            , groomCountry
            , groomPhone
            , groomEmail
            , groomWebsite
            , groomListing
            ) VALUES (
             '". $shopName ."'
            ,'". $groomPropName ."'
            ,'". $groomStreet ."'
            ,'". $groomCity ."'
            ,'". $groomProvince ."'
            ,'". $groomCountry ."'
            ,'". $groomPhone ."'
            ,'". $groomEmail ."'
            ,'". $groomWebsite ."'
            ,'". $groomListing ."'
            )";
        
        if (!mysql_query($sql,$con))
        {
        die('Error: ' . mysql_error());
        }
            
        $to = "webmaster@caninereview.ca";
        $subject = "New listing in groomers directory";
        $message = "There's a new listing for " . $_POST['shopName'];
        $from = $_POST['groomEmail'];
        $headers = "From:" . $from;
        mail($to,$subject,$message,$headers);
        
        header("Location: CRcart/directory_list_logo.php");
        exit();
    }
    Try this code and see what happens.

    one other thing is to take your database connections and put them in a separate file called something like connection.php. Then include that file wherever you are accessing the database,

    connection.php
    Code:
    $con = mysql_connect("host","user","pass");
    if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
    
    mysql_select_db("88888", $con);
    


    Then where you want to use that connection:
    Code:
    include('connection.php');

    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  12. #12
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Location
    British Columbia, Canada
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by spikeZ View Post
    Hi Helen and awesome effort on the learning, very refreshing to see people willing to have a go!
    Thanks, spikeZ (or should I be calling you Mike?). I do have a background in databases and even took a BASIC programming course years (MANY years) ago, so this isn't all totally foreign to me - just the php part. :>)

    Quote Originally Posted by spikeZ View Post
    Try this code and see what happens.
    I did copy/paste all your code into my page but it doesn't work at all now. A wild stab at guessing why is because the "hidden value" in: if(isset($_POST['hidden_value'])) isn't set anywhere? Either that or I copied it into the wrong place. I put it in place of:

    $sql="INSERT INTO groomers (shopName, groomPropName, groomStreet, groomCity, groomProvince, groomCountry, groomPhone, groomEmail, groomWebsite, groomListing)
    VALUES
    ('$_POST[shopName]','$_POST[groomPropName]','$_POST[groomStreet]','$_POST[groomCity]','$_POST[groomProvince]','$_POST[groomCountry]','$_POST[groomPhone]','$_POST[groomEmail]','$_POST[groomWebsite]','$_POST[groomListing]')";

    if (!mysql_query($sql,$con))
    {
    die('Error: ' . mysql_error());
    }

    $to = "webmaster@caninereview.ca";
    $subject = "New listing in groomers directory";
    $message = "There's a new listing for " . $_POST['shopName'];
    $from = $_POST['groomEmail'];
    $headers = "From:" . $from;
    mail($to,$subject,$message,$headers);

    header("Location: CRcart/directory_list_logo.php");
    exit();

    I left in the little bit following that - mysql_close($con)
    ?>

    I'm not ignoring your other comments ... well, I guess I am for now but because of the way my brain works (or rather, doesn't work) I need to do one thing at a time. :>)

    Thanks so much for the help!

  13. #13
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by Helen W Lee View Post
    Thanks, spikeZ (or should I be calling you Mike?)
    Mike is fine


    Quote Originally Posted by helen
    I did copy/paste all your code into my page but it doesn't work at all now. A wild stab at guessing why is because the "hidden value" in: if(isset($_POST['hidden_value'])) isn't set anywhere?
    Exactly!

    You need to add to your <form> a hidden field
    Code:
    <input type="hidden" name="hidden_value" value="1">
    


    That will be checked by the script and only run when it finds it.

    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  14. #14
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Location
    British Columbia, Canada
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Duh. I should have known that but wasn't thinking. I did add the hidden field coding to the form page and then it worked, except I had to correct the shopname variable to shopName, as it originally didn't pass the value through. Since my forte when I was taking the programming course was troubleshooting the crummy code I wrote, it wasn't hard to fix that and now it works perfectly. Thanks so much Mike!

    I'll set up a new topic for the other question I had. Thanks also for the suggestion about including all the connection info in its own file. Since the DW tutorial I've been following has me setting up the connection somewhere in DW (can't for the life of me remember where now!!) I have it in one line at the top of the page: <?php require_once('Connections/db9568.php'); ?> and for now will stick to that but if I have problems later, I'll know a solution to try ... assuming I can remember it. That's my biggest problem - I figure I'm having a good day when I can remember my own name! (only partly kidding <G>)

    Thanks again!

  15. #15
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    Wow, just more proof the ONLY thing you can learn from Dreamweaver is how NOT to build a website... I mean, I've seen some STUPID malfing use of sprintF in my time, but ... just... wow. I lack the words in polite company.

    Yeah, pull ALL of the sprintF as a pointless, useless waste of processing time and memory and just build the strings.

    Or join us in THIS century by switching everything to database interfaces MEANT for that type of processing; specifically mysqli or PDO. LOOKS like what's 'needed' there is a prepare/bind/execute, not this mess of 'data processing for nothing'.

  16. #16
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Location
    British Columbia, Canada
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I hear you deathshadow60. I really don't like DW at all (as a dyed in the wool GoLive user since forever) but since I'm going to be forced to upgrade my OS to Lion in order to keep my MobileMe e-mail address, etc., I've been forcing myself to use DW. Of course, the version of GL I've been using (CS2) doesn't support database stuff so I'd have to use DW for that but I do miss all the other things GL can do which DW can't. I had to get this database system up and running quickly, though, and since I'd never touched any php/mysql stuff before and knew that DW could handle it, I went that route and did get the system going and generating revenue. From here on in, though, I'll try to find tutorials elsewhere, as I'm slowing getting my antique brain around the php stuff and it doesn't scare me quite as much as it did a month ago. :>)

  17. #17
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Helen W Lee View Post
    I really don't like DW at all (as a dyed in the wool GoLive user since forever)
    Golive isn't any better. "Generators" and "tools" that make code for you tend to vomit up broken useless code... just like the garbage WYSIWYG editors barf out HTML that isn't worth a flying purple fish.

    Quote Originally Posted by Helen W Lee View Post
    up and running quickly
    So... unrealistic expectations. Gotcha. Sucks when painted into a corner like that, more so when you're trying to do it with off the shelf tools that don't work, aren't going to work, and on the whole are nothing more than overpriced scams.

    Next time, do yourself a favor -- take the time to learn PHP/SQL and code them directly with a text editor just like you should your HTML/CSS and avoid any stupid 'wizards' to make code for you. NEVER works, road to failure.

    ESPECIALLY if it has the name "Adobe" on it.

  18. #18
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Location
    Florida
    Posts
    58
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Helen W Lee View Post
    I really don't like DW at all
    I learned on DW3, and then went to gEdit and Terminal when I learned how bad my code really was. About a year or so ago I found Aptana, and I havent stopped using it since. It has some of the best of DW's features, like rememebering your variable,function and or class names for auto complete, color highlighting,project management and the better basic stuff without all of the fluff that bogs down your machine. (and the code snippets are usually usable)

    I think they have plugins from eclipse in order to mimic DW

    In DW's defence I do miss the built in html editor, and although you can edit aptana themes, DW had syntax highlighting and colors cornered

    Its worth a look into if your like me and came from that environment, and are looking for "code" writer

  19. #19
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Location
    British Columbia, Canada
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was quite interested in your suggestion about aptana until I got to the word "themes". I have too many sites I've built from scratch to use with a theme-based application, if that's what it is. I prefer to do the design (such as it is) myself rather than use a theme or template. There *are* things about DW I like but I really miss, for example, being able to click on a file in the site list and choose the In/Out button to see what files are connected to my chosen one. Then there's the whole site issue - DW is VERY clunky in this regard and not always accurate. GL has such a great site handling ability and I really don't trust DW in that regard, so end up taking a lot of time to manually upload files. Although, having said that, in some instances it's a lot faster to manually upload than to sit for what seems like minutes while DW grindingly slowly checks through all the files to see what's changed ... and then misses some. Or finds some which have *not* changed. I'm really not impressed. I suppose it's possible DW CS5.5 is better than what I have (CS5) but I'm not prepared to spend any more money on it. I will go and take a look at Aptana, though - thanks for the suggestion!

  20. #20
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    DW and Aptana are development tools to produce sites, by themes James means the visual appearance of the program. Same as if you change the colour on OSX.

    If I were in your position I would download either Aptana or Komodo Edit (free version) and get stuck into learning how to code properly from the start.
    As DS60 so succinctly put it, the programs like DW aren't the best way of doing it - they are just a way.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  21. #21
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Location
    British Columbia, Canada
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by spikeZ View Post
    by themes James means the visual appearance of the program. Same as if you change the colour on OSX.
    Thanks for clarifying that. I do plan to check out Aptana and will also check Komodo Edit. I'm finding that I have to work in code view most of the time anyway, when working with the php stuff, so there's not much benefit to DW in that respect. I'm learning SO much so fast. <LOL> Thanks to the comments about my form problem yesterday (or was that the day before) I've rebuilt all the forms (3 or 4) so that they now all work properly without all the extraneous DW coding. In the process, I'm getting a much better grip on how to work with php. Thanks again everyone!

  22. #22
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Location
    Florida
    Posts
    58
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Helen W Lee View Post
    Thanks for clarifying that. I do plan to check out Aptana and will also check Komodo Edit. I'm finding that I have to work in code view most of the time anyway, when working with the php stuff, so there's not much benefit to DW in that respect. I'm learning SO much so fast. <LOL> Thanks to the comments about my form problem yesterday (or was that the day before) I've rebuilt all the forms (3 or 4) so that they now all work properly without all the extraneous DW coding. In the process, I'm getting a much better grip on how to work with php. Thanks again everyone!
    you seem at least somewhat knowledgeable so the good part is once you understand one language the rest become fairly simple as a lot of the syntax across many patforms is similiar in some way or another, its just a matter of remembering the exact syntax, thank god for google huh?


    ........I sometimes wonder though, with all of the different languages/cms/platforms whatever. Admittedly i do a lot of copy pasting, editing and then refining.
    Does that change my job title to "Reverse Engineer" ?


  23. #23
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Location
    British Columbia, Canada
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by JamesKenny View Post
    you seem at least somewhat knowledgeable
    Thanks. I'm no expert but I *have* been doing basic html stuff since the 90s and did take a programming course (in BASIC) back in the 80s. Trouble with the programming was that I wrote lousy code. Then when I saw what went wrong I found it easy to fix. The same still holds. It would take me a lot less time if I could just write the code correctly in the first place but that doesn't seem to be the way my brain works. :>)

    Quote Originally Posted by JamesKenny View Post
    thank god for google huh?
    Absolutely!!

    Quote Originally Posted by JamesKenny View Post
    ........I sometimes wonder though, with all of the different languages/cms/platforms whatever. Admittedly i do a lot of copy pasting, editing and then refining.
    Does that change my job title to "Reverse Engineer" ?

    That's pretty much what mine should be, that's for sure. Once I get a page that works, I tend to do a Save As to a different name and then tweak, rather than start again from scratch. With the current project, that works perfectly for all the different forms I need to build. :>)

  24. #24
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Location
    British Columbia, Canada
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK Mike - you've created a monster here. <G> I'm trying to get a bit fancier with the form I've built but for the life of me can't figure out why I can't get a radio button value to pass into the database. I have the buttons set up on the html page and they display on the form but no matter which option I click (yes or no at present), nothing goes into the database. Is there some other way the insertion is handled than the way you taught me above (on the separate page using real_escape_string etc.)? Or is there a better way to allow the user to make selections? I've been struggling with this for about 4 hours now and can't figure it out. I'd just like people to be able to choose which of six options they offer.

  25. #25
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Location
    Florida
    Posts
    58
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by deathshadow60 View Post
    ESPECIALLY if it has the name "Adobe" on it.
    Thats a bit unfair.

    Photoshop keeps getting bulkier, but i dont know of an image editing software that compares, if i had a windows machine I would definately think about getting a new one.

    i have had the pleasure of using their flash editor too, not necasarily editing, but creating new animated flash objects with listners, clicking those little keys and typing your little block of code is much easier than trying to learn the entire language(i dread that day).


    @Helen are the name and value set?
    what are you trying to catch the value with?
    <input type="radio" value="yes" name="options" />Yes<br />
    <input type="radio" value="no" name="options" />No<br />


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
  •