PHP code

I wish for the next generations of MUSE to easily paste PHP codes in the page and also be fantastic would manage (forms of conatct) for everyone. Not only for an Adobe Business catalyst members. It is not just as a Member of Adobe CC does not being able to use the forms to any Web site.

I sent you PM from your site. Stan

Tags: Adobe Muse

Similar Questions

  • WC3 validation of html page with php code

    I am trying to validate a web page ( http://www.flamingobeachcrfishing.com ) which includes the php code to extract information from a database using Dreamweaver cc 2015. I'm in code view.  I get error w3c to php code.  The page works fine. Is there a way to w3c check flow online (direct control) on the page?

    Run http://validator.w3.org/nu

  • PHP code takes the first record in the database regardless of the selected one

    I struggled for hours with this trying to see why no matter what file is selected, the record displayed is always the first. It must be a stupid mistake on my part, but I can't see it.

    I use DW CC 2015 with WebAssist server for server code additions. I looked at the database itself, and it's OK.

    Test data

    Capture.JPG

    Copy the following code enumerates the various documents in the database. (I removed my HTML that works well for brevity).

    <? php require_once('.. /.. /.. / Connections/Terrier.php');? >

    <? php require_once('.. /.. /.. / webassist/mysqli/rsobj.php');? >

    <? PHP

    $rsDocuments = new WA_MySQLi_RS ("rsDocuments", $Terrier, 1);

    $rsDocuments-> setQuery ("" SELECT * FROM documents ' ");

    $rsDocuments-> execute();

    ? >

    <! doctype html > < html >

    "' Snip...

    < p align = "left" > < a href = "add_terrier_document.php" > add new record of Documents < /a > < /p >

    < table width = "100%" border = "1" cellspacing = "2" cellpadding = "2" >

    < tbody >

    < b >

    < td width = "26%" align = "left" > < strong title > < / strong > < table >

    < td width = "52%" align = "left" > < strong text > < / strong > < table >

    < td width = "6%" align = "center" > < table >

    < td width = "6%" align = "center" > < table >

    < td width = "6%" align = "center" > < table >

    < /tr >

    <? PHP

    {While (! $rsDocuments-> {atEnd())}

    ? >

    < b >

    < td > <? PHP echo ($rsDocuments-> getColumnVal ("dc_title"));? > < table >

    < td > <? PHP echo ($rsDocuments-> getColumnVal ("dc_text"));? > < table >

    < td width = "6%" align = "center" > < a href = "view_terrier_document.php? dc_index = <?" PHP echo ($rsDocuments-> getColumnVal ("dc_index"));? > "> view < /a > < table >"

    < td width = "6%" align = "center" > < a href = "edit_terrier_document.php? dc_index = <?" PHP echo ($rsDocuments-> getColumnVal ("dc_index"));? > "> edit < /a > < table >"

    < td width = "6%" align = "center" > < a href = "confirm_terrier_document_delete.php? dc_index = <?" PHP echo ($rsDocuments-> getColumnVal ("dc_index"));? > "> delete < /a > < table >"

    < /tr >

    <? PHP

    $rsDocuments-> moveNext();

    }

    $rsDocuments-> moveFirst(); return the RS to the first record

    ? >

    < / tbody >

    < /table >

    < a href = "<?" PHP echo $rsDocuments-> getFirstPageLink();? > "> first < /a > - < a href =" <? PHP echo $rsDocuments-> getNextPageLink();? > "> Next < /a > - < a href =" <? PHP echo $rsDocuments-> getPrevPageLink();? > "> previous < /a > - < a href =" <? PHP echo $rsDocuments-> getLastPageLink();? > "> last < /a >"

    < p >

    .... SNIP

    The table shows the different records in the database. I can go through the files back and forth and pick any one to edit - say one-third.

    The PHP code creates the URL of http:// localhost/priory_database_2/gateway/Terrier/documentation/edit_terrier_document.php?dc_in dex = 3

    However, the record that is displayed is always record 1, regardless of the currently selected folder.

    The edition code (less HTML) is.

    <? php require_once('.. /.. /.. / Connections/Terrier.php');? >

    <? php require_once('.. /.. /.. / webassist/mysqli/rsobj.php');? >

    <? php require_once('.. /.. /.. / webassist/mysqli/queryobj.php');? >

    <? PHP

    $rsDocuments = new WA_MySQLi_RS ("rsDocuments", $Terrier, 1);

    $rsDocuments-> setQuery ("SELECT * FROM documents ORDER BY dc_index ASC");

    $rsDocuments-> execute();

    ? >

    <? PHP

    If (isset($_POST["submit"]): isset($_POST["submit_x"])) {}

    $UpdateQuery = new WA_MySQLi_Query ($Terrier);

    $UpdateQuery-> action = 'put up-to-date. "

    $UpdateQuery-> table = 'documents '.

    $UpdateQuery-> bindColumn ("dc_index", "s", "".) "((isset($_POST["dc_index"])))? $_POST ["dc_index"]:" ")". "" (', 'WA_DEFAULT');

    $UpdateQuery-> bindColumn ("dc_title", "s", "".) "((isset($_POST["dc_title"])))? $_POST ["dc_title"]:" ")". "" (', 'WA_DEFAULT');

    $UpdateQuery-> bindColumn ("dc_text", "s", "".) "((isset($_POST["dc_text"])))? $_POST ["dc_text"]:" ")". "" (', 'WA_DEFAULT');

    $UpdateQuery-> bindColumn ('date_recorded', "s", "".) "((isset($_POST["date_recorded"])))? $_POST ["date_recorded"]:" ")". "" (', 'WA_DEFAULT');

    $UpdateQuery-> bindColumn ("date_update", "s", "".) "((isset($_POST["date_update"])))? $_POST ["date_update"]:" ")". "" (', 'WA_DEFAULT');

    $UpdateQuery-> addFilter ('dc_index', '=', 'i', ' ".) () $_GET ['dc_index']). » ») ;

    $UpdateQuery-> execute();

    $UpdateGoTo = 'index.php ';

    "If (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo? rel2abs ($UpdateGoTo, dirname (__FILE__)):" ";" "

    $UpdateQuery-> redirect ($UpdateGoTo);

    }

    ? >

    ..... Snip


    < /table >

    < h3 align = "center" > change the document details < / h3 >

    < form id = "AddDocumentRecord" name = "AddDocumentRecord" method = "post" >

    < label for = "dc_title" > title

    < name textarea = "dc_title" cols = "150" lines = "3" maxlength = "300" id = "title" > <? PHP echo ($rsDocuments-> getColumnVal ("dc_title"));? > < / textarea >

    < / label >

    < label for = "dc_text" > Description

    < name textarea = "dc_text" cols = "150" lines = "20" maxlength = "60000" id = "text" > <? PHP echo ($rsDocuments-> getColumnVal ("dc_text"));? > < / textarea >

    < label for 'date_recorded' = > registration Date:

    < name textarea = 'date_recorded' cols = "50" rows = "1" maxlength = "20" id = 'date' > <? PHP echo ($rsDocuments-> getColumnVal ("date_recorded"));? > < / textarea >

    < / label >

    < label for = "date_update" > Date of last update:

    < name textarea = "date_update" cols = "50" rows = "1" maxlength = "20" id = "Refresh" > <? PHP echo ($rsDocuments-> getColumnVal ("date_update"));? > < / textarea >

    < / label >

    < input type = "submit" name = "submit" id = "submit" value = "Submit" >

    < input name = "dc_index" type = "hidden" id = "dc_index" value = "<?" PHP echo ((isset($_POST["dc_index"]))? $_POST ["dc_index"] ":" "")? > ">"

    < / make >

    ... Snip

    The query for the edit page should look like

    $rsDocuments = new WA_MySQLi_RS ("rsDocuments", $Terrier, 1);

    $rsDocuments-> setQuery ("SELECT * FROM documents WHERE dc_index =?");

    $rsDocuments-> bindParam ('i', ' ".) "(isset($_GET['dc_index']))? $_GET ['dc_index']:" ")". "" », «-1 ») ;

    $rsDocuments-> execute();

    What this did that select a recording with a value of dc_index.

  • How I can add the php code in my Web site muse

    How I can add the php code in my site muse?

    Insert you user-defined html.

    Mylenium

  • Looks great in mode live view, but not in Design view after adding php code

    Can anyone help with this?  I have a php with HTML5 page that looks much like the design view, live view and in the browser. I add php code above <! doctype html > and the page goes in all directions in design mode. If I switch to live view, the page looks a lot like new. The above code <! doctype html > is php with zero html completely. It's as if design mode try to read php despite start-up code and tags php in place.

    The only work around, I have found is to place <! doctype html > at the top of the page and view design looks great again, but this cannot be used in the browser as I have the php code that requires it to be the first items found.

    I use Dreamweaver CC 2014

    Any help greatly appreciated,

    Dave

    Nancy, just to update you I had a bit of success by changing my invisible elements preferences.

  • PHP-Code in Adobe Muse CC 2014 einfügen - Wie geht das?

    Hallo,

    ICH möchte like ein PHP-File in Adobe Muse CC 2014 einbinden, aber wie geht das? ICH habe are already uber das Menufeld 'Objekt' > "HTML einfügen" versucht, aber der Code wurde auch mit richtiger Schreibweise nicht erkannt. Auch wenn ich den Code über Adobe Dreamweaver einfuge works dies nicht users.

    Wie ich ein PHP-File bzw fuge. Richtig ein PHP code?

    PHP is not supported in Muse right now. Only HTML, CSS and JavaScript.

  • sugestion of php code to the xml files?

    Hello..

    I have dreamweaver cs5 and I use .htaccess to be able to use php in .xml to make the RSS and site map...

    Everthing works fine but the php code that I put in any xml doc comes gray sugestion and php does not work...

    any ideas how I can get this working?

    Thank you

    I have dreamweaver cs5 and I use .htaccess to be able to use php in .xml to make the RSS and site map...

    Everthing works fine but the php code that I put in any xml doc comes gray sugestion and php does not work...

    any ideas how I can get this working?

    This technical note explains how to add and modify the exntensions recognized by DW:

    http://kb2.Adobe.com/CPS/164/tn_16410.html

    Tip: remove the documenttype (winfileextension and macfileextension) XML "xml", and then add it to the documenttype PHP_MySQL.

    HTH,

    Randy

  • I get this error with my login form, I did, but I'm not sure if this is a problem with my php code or

    I get this error with my login form when I try to log in, but I'm not sure if this is a problem with my php code or my flex code!

    ReferenceError: Error #1069: loginsuccess property not found on string and there is no default value.
    CBC::main/checkLogin()
    CBC::main/__login_user_result()
    to flash. events::EventDispatcher / dispatchEv...
    to flash. events::EventDispatcher / dispatchEv...
    to HTTPOperation / http://www.Adobe.com/2006/Flex/MX/internal:dispatchRpcEvent ()
    to mx.rpc::AbstractInvoker / http://www.Adobe.com/2006/Flex/MX/internal:resultHandler ()
    at mx.rpc::Responder/result()
    at mx.rpc::AsyncRequest/acknowledge()
    to the DirectHTTPMessageResponder/completeHandl...
    to flash. events::EventDispatcher / dispatchEv...
    to flash. events::EventDispatcher / dispatchEv...
    at flash.net::URLLoader/onComplete()


    my php code is:


    [php] <? PHP

    define ("DATABASE_SERVER", "localhost");

    define ('DATABASE_USERNAME","f4r");

    define ('DATABASE_PASSWORD', 'cool23');

    define ('database_name', 'bignixs1');

    connect to the database

    $mysql = mysql_connect (DATABASE_SERVER, DATABASE_USERNAME, DATABASE_PASSWORD) or die (mysql_error ());

    Select the database

    @mysql_select_db (DATABASE_NAME);

    re-branded the data passed from Flex to variables

    $username = mysql_real_escape_string ($_POST ["usernam...)

    $password = mysql_real_escape_string ($_POST ["passwor...)

    Ask the database to see if the combination of username/password given name is valid.

    $query = "SELECT * from users WHERE username = 'username' AND password = 'password" ";

    $result = mysql_fetch_array (mysql_query ($query));

    start generating XML

    $output = "< loginsuccess > ';

    If the query returned true, exit < loginsuccess > Yes < / loginsuccess > other output < loginsuccess > not < / loginsuccess >

    if(!$result)

    {

    $output. = « no » ;

    } else {}

    $output. = "yes";

    }

    $output. = "< / loginsuccess > ';

    all the XML for output

    print ($output);

    ? > [/php]

    $query = "SELECT * from users WHERE username = 'username' AND password = 'password" ";

    should be

    $query = "SELECT * FROM users WHERE username = '$username' AND password =  '$password'";
    

    example of a system of working with the correct connection code flex & php to ensure:

    http://www.mattlefevre.com/viewExample.php?tut=flexPHP&proj=simple%20Login%20Application

  • Deactivation of PHP code hinting

    Is it possible to disable the code for PHP hints, but not HTML? I tried to deselect each individual option under the guidance of Code in the preferences window, but nothing. The only way that I can't seem to do is uncheck the box Enable Code hinting.

    Find very useful for HTML code hinting, drop-down menus, dealing especially with the CSS attributes... it's priceless. However, tips for PHP code are pretty useless for me. It is not a drop-down menu, but rather a mouseover text window that shows you the basic structure of the function you are going to use. First of all, the window starts across other code above it, which can be stop your workflow. Second, if I type the name of a PHP function... I no longer know how to use already or I am to my other monitor which visualizes php.net. I need not DW to make a lame attempt to help me write PHP code.

    I know I can hit ESC or DELETE to make this window go away, but we will tell you to use a function with two parameters... shabam! The mouseover boring and useless is displayed when you press the comma key to enter in the second parameter... uggggg.

    Any tips or advice? Adobe has a suggestion box?

    NickTheNameless wrote:
    > I need not DW to make a lame attempt at the
    > help me to write PHP code.

    I'm surprised it's a lame attempt, as the two Zend Studio and
    PhpED offers exactly the same type of code hinting. You can also enable
    a drop of about 2 600 functions PHP by pressing
    CTRL + space anywhere within a block of PHP code. Personally, I find the code
    advice far lame (although I'd like Dreamweaver to be more
    proactive by introspection of the code as well).

    Anyway, if you want to get rid of PHP code hinting, locate the following file:

    C:\Program Files\Adobe\Adobe Dreamweaver
    CS3\configuration\CodeHints\CodeHints.XML

    Delete lines 327 to 2965. Code hinting will be upset is no longer with you.

    --
    Adobe Community Expert David Powers
    Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • PHP code to perform calculations

    How can use php code to calculate an everage of all entries in a table column? I'm sure it's easy, but I have no idea. I found this code on the net. I understand, but I don't know how I refer to my database since it is called one require a single line. So basically I'm not sure what comes after the 'From' in the code below.

    <? PHP
    function average_value()
    {
    $query = "SELECT SUM (friendly) of assessment";
    $result = mysql_query ($query);

    Number of people in the table
    $num = mysql_num_rows;

    $sum = mysql_result ($result, 0);
    $average = ($sum / $num);
    $average = round ($average, 1);

    return "is the average score for useful." $average;
    }
    ? >

    Darren

    Hello David,.

    Thank you much for the help. It was as easy as you said. I guess I wasn't seeing the forest with all the trees in the way.

    I created the new recordset in the server behavior Panel. Then I manually interlaced the select statement with the one that you suggested. I then had to manually create the echo of statements for the results, since it was more in the bindings panel once I edited the select statement.

    It is a great help for me in the assessment in the development and content of the survey for the students of our school. It's so easy with hindsight but so powerfully useful.

    Thanks again David for your patience and your advice.

    Darren

  • Strange generated PHP code

    I attached some generated DW CS3 using PHP code. I'm not a PHP expert, but just looking at the code you can see the same "GetSQLValueString" function, said over and over again. On one page, I saw this set 5 times, 4 deletion of definitions, and then was able to view my page. I know that this isn't a complete explanation, maybe I deleted some media that were causing problems, but the point is that it is all generated code in DW. Please see the code attached if you're a PHP expert and can perhaps shed some light for us pedestrians. There Adobe experts out there on this forum? There was once, but it is looking like a Council deserted lately.

    "davidbarrackphoto" wrote in message
    News:fhi56c$PFI$1@forums. Macromedia.com...
    > I am attached a certain DW CS3 using PHP code. I'm not a PHP
    > expert, but just looking at the code you can see the same function
    > "GetSQLValueString" said over and over again. On one page, I saw that
    > set 5 times, 4 deletion of definitions and then my page was able to
    > Display. I know that this isn't a complete explanation, maybe I deleted some
    > media
    > that were causing problems, but the point is that it is all generated DW
    > code.
    > Please see the code attached if you're a PHP expert and can maybe throw
    > some
    > light for us pedestrians. Are there experts out there on Adobe this
    > Board of Directors?
    > There once was, but he is looking like a Council deserted lately.

    This code has been added to avoid problems with the previous PHP SQL injection
    Setting up MySQL,
    Why on Earth, they chose to put it over and over again instead of use
    an inclusion or put in the connection file is beyond me...

  • PHP code in the template before &amp; lt; HTML &amp; gt;

    I create a model for a series of pages on my site that's actually going to be PHP pages and I wanted to put PHP code at the top of the page, before any HTML tag. This is necessary, for example, to call "session_start' (which creates a cookie) before any other output to the browser.

    I was able to do initially, but found that I can't make any changes to this code and have Dreamweaver to apply to pages based on the template. DW8 gives me an error message to make changes 'outside the html tags"and does not, apply them.

    This is not a show-stopper since it involves only a few pages, but is there a way to get around this restriction, and nobody knows if it also works this way in CS3 (or CS4?).

    > Thank you. This would work OK for me. How can I go about it?

    Add this to the head region of your template-

    Once make you and save the page template, all CHILDREN PAGES WILL BE
    SYNCHRONIZED WITH THE WRITING OF SCRIPTS PRESENT IN THE MODEL. You will no longer
    able to add a single server script for any page of the child. Just so you know...

    > Can you explain what you mean? Part of what I put in this section are PHP
    > 'require' statements, which are a type of server-side include, unless you
    > are
    > talking about something different.

    I'm not. Although you can use an 'include' statement too (there's one in)
    PHP). I just want to say that the script that are usually placed in code snippets
    each page (such as login scripts) are usually managed with inclusion.

    --
    Murray - ICQ 71997575
    Adobe Community Expert
    (If you * MUST * write me, don't don't LAUGH when you do!)
    ==================
    http://www.projectseven.com/go - DW FAQs, tutorials & resources
    http://www.dwfaq.com - DW FAQs, tutorials & resources
    ==================

    "gordonwd" wrote in message
    News:g62tv6$5m5$1@forums. Macromedia.com...
    >

    Quote:
    Posted by: newsgroup user
    > If you opt for the latter, then all the child pages will always receive ALL
    > changes to the page model, and you will NOT be able to add single
    > scripts on the pages of the child in these areas, because they will be so
    > be
    > locked. If you want to opt for this choice, after return, and I'll tell
    > you
    > How to do it.
    >

    >
    > Thank you. This would work OK for me. How can I go about it?
    >
    >

    Quote:

    > Normally, things like you describe are handled with server-side
    > includes,.
    > using the default template.
    >

    >
    > Can you explain what you mean? Part of what I put in this section are PHP
    > 'require' statements, which are a type of server-side include, unless you
    > are
    > talking about something different.
    >
    > --
    > Murray - ICQ 71997575
    > Adobe Community Expert
    > (If you * MUST * write me, don't don't LAUGH when you do!)
    > ==================
    > http://www.projectseven.com/go - DW FAQs, tutorials & resources
    > http://www.dwfaq.com - DW FAQs, tutorials & resources
    > ==================
    >
    >
    > "gordonwd" wrote in message
    > news:[email protected]...
    > I create a model for a series of pages on my site that are
    > actually
    > going to be PHP pages and I wanted to put PHP code right in the top of
    > the
    > page, before any HTML tag. This is necessary, for example, to
    > call
    > "session_start' (which creates a cookie) before any other output of the
    > browser.
    > >
    > I did initially, but find that I can not make any changes
    > to
    > This code and have Dreamweaver to apply to pages based on the template.
    > DW8
    > gives me an error message to make changes 'outside the html tags.
    > and
    > fact
    > not to apply them.
    > >

    > This is not a show-stopper since it involves only a few pages, but is
    > It
    > any way to bypass this restriction and does anyone know if it also works
    > this way
    > in CS3 (or CS4?).
    > >
    >
    >
    >
    >
    >

  • WebDAV removes the file PHP code

    I use an include file to my browsing on the site and every time I check the file from the server OSX via WebDAV all my PHP code is removed from the file, and I find myself with just hypertext. I use Dreamweaver 8.

    If I change the code in the file and check again, then the file is good until the next time I check it out, when the same thing is happening. Anyone have any ideas?

    This is a limitation of webDAV/HTTP. There is a single application of HTTP GET, so the server cannot tell if the request is from a browser (dynamic content in HTML rendering), or publishing tool, (IE Dreamweaver). To resolve this problem in apache, we set up a virtual server that listens on a different port and force the text/plain, so that the dynamic content is not rendered for dreamweaver... Here is a link that might help with OSX:
    http://www.macosxhints.com/article.php?story=2003072620172473

  • PHP code the code works but aspx does not work...

    First of all - many apologies because it is NOT directly associated if I use Dw CS6 and Visual Studio 2012 set of Dreamweaver.

    I have two pages of contact - want it in aspx rather than php because I get vb code while I do not understand php.

    In addition to this, I add validation in the aspx version that I do not know how to do it in a php page.

    Then...

    The php version works with the mail command.

    It DOES NOT REQUIRE to have a specified smtp mail server AND IT WORKS.

    However try the same in VB/ASP.NET is a different baby.

    Thanks in advance for any comments.

    Terry

    the php file is: -.

    ------------------------------------------------------------------------------------------ -----------

    < body >

    <? PHP

    $recipient = ' [email protected] ';

    $subject = "EXAMPLE PHP CONTACT."

    Success message sent to the user after the e-mail was sent. / / You can leave it as what or change the wording.

    $success = "< h1 > thank you to fill out and submit the form. < / h1 > < p > someone will process your message and get back to you as soon as posible. "< /p > < p > < a href =" / "> < /a > back to Home Page < /p >";

    error message sent to the user. / / You can leave it as what or change the wording.

    $failure = "< h1 > there was an error by e-mail information < / h1 > < p > we could not send your information to return of form at the moment." < /p > < p > please wait a few minutes and try again. "< /p > < p > < a href =" / "> < /a > back to Home Page < /p >";

    ###########################################

    Do not edit below this line

    ###########################################

    Collect all the information on the form and check that all fields have been filled.

    $email = $_POST ['email'];

    If (sizeof($_POST)) {}

    $message = "";

    While (list ($key, $val) = {each($_POST)})

    If ($key == 'Submit') {}

    do nothing

    }

    else {}

    $message. = "$key: $val\r\n";

    Checks if the $val contains data

    {if (Empty ($Val))}

    ECHO ("< h1 > error in the entry of the form < / h1 > < p > all the form fields must be filled in and some have not been filled in. < /p >")

    < p > please visit < a href = "javascript: history.go(-1)" ' > back < /a > and try again < /p > ");"

    Exit();

    //}

    }

    }}

    Validate email address

    If(!preg_match("/^[a-z0-9]+([_\\.-][a-z0-9]+) * '. ' @". " ([a-z0-9]+([\.-][a-z0-9]+)*) + ". » \\. [a - z] {2,}"." $/ "(,$email)) {}"

    ECHO ("< h1 > error in form input < / h1 > < p > a wrong e-mail address was entered.") < /p > < p > please go < a href = "javascript: history.go(-1)" ' > < < /a > /a > back, and then try again > /p > ");"

    Exit();

    }

    ###########

    function filter_email_header ($form_field) {}

    Return preg_replace ('/ [\0\n\r\|\!\/\<\>------^-$-%------*--------&] + / ', ", $form_field);

    }

    $email = filter_email_header ($email);

    $headers = "from: $email\n";

    $sent = mail ($recipient $subject, $message, $headers);

    If ($sent)

    {

    the below html code can be modified to change the user receives the message of thanks

    ? >

    Success of < h1 > < / h1 >

    < /P > < p > SUCCESS

    <? PHP

    } else {}

    the message that is sent to the user if the form information has not been sent.

    ? >

    < h1 > something went wrong < / h1 >

    < p > SOMETHING going ON WRONK < /p >

    <? PHP

    }

    ? >

    < / body >

    ---------------------------------------------------------------------------------

    The aspx file is: -.

    ---------------------------------------------------------------------------------

    Imports System.Net

    Imports System.Net.Mail

    Partial Class _Default

    Inherits System.Web.UI.Page

    Protected Sub btnSubmit_Click (ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

    Me.lblError.Text =""

    Me.divResultDiv.InnerHtml = "XXXX".

    lblName.Text = «»

    lblEmail.Text = «»

    ' -------------------  validation  ---------------------

    If Trim (Me.txtName.Text) = "" then

    lblName.Text = "this field is required.

    Exit Sub

    End If

    If Trim (Me.txtEmail.Text) = "" then

    lblEmail.Text = 'this field is required.

    Exit Sub

    End If

    If Trim (Me.txtEmail2.Text) = "" then

    lblEmail2.Text = 'this field is required.

    Exit Sub

    End If

    If (txtEmail.Text) Trim <>Trim (txtEmail2.Text) then

    lblEmail2.Text = "e-mail addresses must match to.

    Exit Sub

    End If

    If Ucase (Trim (txtAnswer.Text)) then <>'WHITE'

    lblError.Text = 'Did not question correctly.'

    Exit Sub

    End If

    ' -------------------  validation  ---------------------

    ' --------------------------------------------------------

    "IF WE GET HERE then EVERYTHING OK - BUILD THE MESSAGE

    ' --------------------------------------------------------

    Dim mail as new System.Net.Mail.MailMessage

    mail. Body = Me.txtComment.Text

    mail. Subject = "MESSAGE FROM WEB.

    mail. To.Add ("[email protected]")

    mail. From = new System.Net.Mail.MailAddress (Me.txtEmail.Text)

    Dim smtp as new System.Net.Mail.SmtpClient

    Dim strMessage As String = «»

    Try

    SMTP. Send (mail)

    "Me.lblStatus.Text ="Message sent... We will answer you as soon as possible"

    strMessage = "< h2 > < / h2 > < h2 > thank you for your inquiry." "< / h2 >" & _

    "< br / > < /p > to SUCCESS."

    Catch ex As Exception

    "Me.lblStatus.Text ="There is an error in sending, please try again in a moment"

    strMessage = "< h2 > < / h2 > < h2 > error sending message < / h2 >" & _

    "< br / > < FAILURE P > < /p >.

    End Try

    Me.Panel1.Visible = False

    Me.divResultDiv.InnerHtml = strMessage

    End Sub

    End Class

    You use System.Net.Mail , which in turn uses SMTP rather than the PHP mail() function.

    To see more

    or Google the topic.

  • Drop into the PHP code to connect using MySQL and MyAdmin

    This code should be as common as dirt, but I need help in looking for it. Considering how most of the sites have a mode of connection it surprises me that DW does not have some kind of widget to encode the fundamentals, but I digress.  I have a family site private, accessible by a username / password to a file static login.php. I think of moving to the next level will require the use of MySQL and a database... which seems a bridge too far... However, what I "think" I want to do is... (especially #5)

    1. a login for predefined members (40 odd) system using a primary e-mail address as ID.
    2. a connection that has a remember me option
    3. a connection that would show the user the last time that he / she has logged in and how many times.
    4. a method of sending an email with the username and password of the user
    5. a method of object defining his username and / or password.
    6. When changes are made an email is sent to me
    7. and... possibly different access levels / permissions, as in, shareholder have full access and no shareholders / clients have access to only a few pages.

    Can point to a location that would have such a code available for a cut and paste the developer... with instructions

    Thank you for your time.

    Ralph3616 wrote:

    1. / * Adds a line of [] $authorization for each pair of login/password you want to add: * /.
    2. [$authorization] = array ('feldon', '123456', ' feldon @google.com ');
    3. [$authorization] = array ('ralphv', '1234only', ' [email protected]');
    4. [$authorization] = array ('guest', '1234guest', ' [email protected]');

    (How?)

    • Check if the email address exists and if so
    • Send an email to this address with the user name and password on this line. And a brief message... "xxxxxx xxxx xxxx" and a subject heading.
    • Otherwise, a different error message on any match and contact [email protected]

    A second page (the result of a failure, login) would have access to my login.php to find the desired information?

    I could make a file (database?) on my server with this list?

    Could this work? Can someone show me how?

    Thank you for your time.

    Here's one way you could do it, BUT it seems a lot of work if you have dozens of users - why your passwords/user names contained in the bays and not a database?

    In any case taking the 3 examples you gave above, and assuming that you have sent your username to a 'recover' username and password ' page that has a form on it asking the the e-mail address of the user (gives the name of "email_address" entry field and then submit directly to the next page) : it grabs the value of the field in the form email_address and then checks through the berries if the email address exists. If he sends the user name and password to this email address.

    I guess it's a site of low security keys so that you need not md5 passwords.

    NOTE PLEASE I HAVE INSERTED AN "X" IN THE E-MAIL ADDRESSES WHICH NEEDS TO BR REMOVED. (SPAM)

    <>

    $email_address = $_POST ['email_address'];

    [$authorization] = array ('feldon', '123456', ' [email protected]');

    [$authorization] = array ('ralphv', '1234only', ' [email protected]');

    [$authorization] = array ('guest', '1234guest', ' [email protected]');

    {If (in_array ($email_address, {$authorization [0]}))}

    $username = "feldon.

    $password = "123456".

    $email = "[email protected]";

    $matchFound = 'success ';

    }

    {If (in_array ($email_address, {$authorization [1]}))}

    $username = "ralphv";

    $password = "1234only";

    $email = "[email protected]";

    $matchFound = 'success ';

    }

    {If (in_array ($email_address, {$authorization [2]}))}

    $username = "guest";

    $password = "1234guest";

    $email = "[email protected]";

    $matchFound = 'success ';

    }

    {if (isset ($matchFound))}

    $to = $email_address;

    Object

    $subject = "Your user name and password";

    $headers = "from: $email_address\r\n";

    $headers. = "reply-To: $email_address\r\n";

    build the message

    $message = ' username: $username\n\n ";

    $message. = "password: $password\n\n";

    mail ($ $subject, $message, $headers);

    ECHO "we sent you an email with your username and password';

    }

    else {}

    echo "no user leaves with the e-mail address provided.

    }

    ?>

Maybe you are looking for