Use PHP or ASP to grab part of another site

Hello all,
I have permission to grab certain contents of pages of a site
that is a
static site. The static pages are updated fairly frequently,
otherwise,
I would just copy and paste.
I'd like to grab all code that is within a standard div tag
with an id
and insert it into my pages.
Is it possible to do this with script? I'm a beginner at both
PHP and
ASP, so any pointers would be great.
PS: to David Powers--great PHP for DW8 book.
-John

John R. Lenz wrote:
> I'd like to grab all code that is within a standard div
tag with an id
> and insert it into my pages.
>
> Is it possible to do this with script? I'm a beginner at
both PHP and
> ASP, so any pointers would be great.
It's certainly doable with PHP. Do a Google search for screen
scraping
with PHP or page scraping with PHP. You'll find quite a few
tutorials.
The theory isn't all that difficult, but a lot depends on
your PHP
setup. You may need to use cURL or a socket connection if
your host has
disabled allow_url_fopen. It would also be a lot easier if
the target
page is valid XHTML and you have PHP 5. You could then use
SimpleXML to
loop through the page nodes to find the ID you want.
Rather than try to scrape the page every time somebody
accesses your
site, I would suggest scraping on a regular basis, say once
an hour, and
storing the content in a text file or a database. Of course,
that means
you need the ability to run PHP files as scheduled events.
It would be much simpler if the other site used a text file
as an
include. You could then grab the include yourself. Much
simpler, much
less hassle.
> PS: to David Powers--great PHP for DW8 book.
Thanks, John. Glad you liked it.
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

Similar Messages

  • How to use layout of one view(some part) in another view

    Hi All,
                 I need how to use a layout of one view(some part) in another view.if anybody knows, help me.
    Ex : I took two views.but some part of layout in first view is also needed in second view.Is it possible.
    Thank You,
    Anupama.

    Hi,
    Whichever common ui elements you want to put in both views. Keep them in one view.
    Now create two views which You want to display.( i.e you have to create three views in that two only will be used for display purpose ) In that both views add viewcontainer ui element and embedd that view which has common UIs. And Then add rest uncommon UIs in both views.
    I hope it helps.
    Regards,
    Rohit

  • Grabbing part of another html document

    I have a page that lists the titles and teasers from other pages on the site. The title is always wrapped in the only h1 tag on the page, and the teaser is wrapped in the only h2 tag on the page, so they're easily identified.
    How can I pull those into a CF page so that I have this kind of list:
    Article1 Title
    Article 1 Teaser
    Article 2 Title
    Article2 Teaser
    Etc.

    What would be better... to try that approach or try and use the supplied XML file?
    I would try both and use the one that works best for you. I generally prefer working with a structured format like XML documents, however if your HTML is consistently formatted using a regular expression may also be a valid approach.
    Any good tutorials out there for learning how to bring xml data into the page
    Take a look at the CF documentation.
    http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24 -7fb3.html
    Ben Forta's books are also a good resource for learning CF and include chapters on XML.
    http://www.forta.com/books/0321679199/

  • Coding to move from one site to specific part of another site?

    Forgive if I am not explaining this very well- here goes. I have one major site with three other gallery sites that are related. From one of the gallery sites I need to create a button that takes you back to a specific page on the major site. Playing with the coding has not resolved the issue so appreciate any help in finding magic:
    on (press) {
        getURL("http://www.client's main site.net","_blank");
    gets me back to the beginning of the major site but I need to get to a certain page within the site. Is this possible? Thank you! All coding is AS2, Mac platfom, FlashCS5.

    if you want to load frame 22, use:
    on(press){
    getURL("http://www.yoururl.com/page.html?framenum=+22","_blank");
    then within the head tags of page.html in yoururl.com, use:
    <script type="text/javascript">
    function urlF(){
    return location.href;
    </script>
    and in the swf that's embedded by page.html, add the following to frame 1:
    import flash.external.ExternalInterface;
    stop();
    trace(ExternalInterface.call("urlF"));
    //  upload that to your server, post the url to the flash containing the getURL() and indicate which button needs to be pressed.

  • Is it possible to extract the text and images using PHP

    Hi friends,
    Is it possible to extract the text and images using PHP, in the same order as it is in the PDF?
    Else is it possible extract the same as XML using PHP, or ASP
    I googled it but its in vain, any help is appreciated.
    Thanks in advance.

    Dear Mike,
    Thanks for your quick reply,
    I mean is it possible to parse the PDF line by line using the PHP.
    I extracted the whole text but couldn't the images. Since the PDF's images are decoded using various methods like DCTDecode, JPXDecode, etc.
    The text is decoded with FlateDecode, which i breaked using a function in PHP.
    Thanks,

  • Web part created on a subsite for a sharepoint list in another site using sharepoint designer, to show only the subsite's reports. Connection dropping off and showing all the reports

    I crated web parts in the sub-sites (we have about 10 subsites) using sharepoint designer from a main list in another site.  Then used web part to show only the  ubsite's reports - using connection to the main list.  Problem is, the connection
    is dropping off and showing all the reports on the main list that are confidential.  this has happened 3 time lately.  Could someone explain why it happens some times?  I had to fix it by adding the web part again and connecting it
    Thanks, Subathy.

    Hi George,
    If you want to use a top level site "department" list column in all sub-sites, you can go to top level site and create a
    lookup type "Site column" to look up the value from the department list, then all sub-sites can use this lookup type site column created in top level site.
    Thanks 
    Daniel Yang
    TechNet Community Support

  • ProjectCenter Webpart on another Site Collection "This Web Part was unable to load"

    Hi,
    Project Server 2013 on an url like http://domain.tld/pwa
    Trying to use the Project Center Web Part from another site collection, let's say http://domain.tld/sites/siteA
    I get the "This Web Part was unable to load" error and in the ULS I get Object Reference not set to an instance of an object classic error
    What am i doing wrong?
    Thanks!

    Thank you for the thoughts Michael but none of those worked for me.    
    What I have done so far is I have added the PWA features to the site which is what has made it work when logged in under the farm account.  
    So I have 3 account I am testing with
    1.) regular account with read only permissions to the Publishing page
    2.) Admin account that is in a group that is a site administrator to ALL sites
    3.) Farm account
    Currently it works for the Farm account and the Admin account but not the regular account.  I have added the regular account to the same group as the Admin account and will test when the change updates to see if I can access the information.  This
    will at least let me know that it is a Permissions issue which is what I think it is I just cant figure out which permission it would need to be. 

  • Problem with Join Queries using PHP and an Orcale Database

    Ok, I am trying to build a simple php querying tool for my oracle database and for the most part it is working however I am having a problem getting data from my join queries. If I run the following query :
    QUERY:
    SELECT lastfirst,EnteredBy,Debit FROM students sts JOIN GLDetail gl ON gl.studentid=sts.id
    RESULT SET:
    Lastfirst     EnteredBy     Debit
    caiu, test      204     1
    But when I run the query correctly I get no results
    QUERY:
    SELECT sts.lastfirst,gl.EnteredBy,gl.Debit FROM students sts JOIN GLDetail gl ON gl.studentid=sts.id
    RESULT SET:
    sts.lastfirst     gl.EnteredBy     gl.Debit
    and if I run the query combining the two above methods and adding a field (schoolid) that has the same name on both table I get the following result sets
    QUERY:
    SELECT lastfirst,EnteredBy,Debit,sts.schoolid FROM students sts JOIN GLDetail gl ON gl.studentid=sts.id
    RESULT SET:
    lastfirst     EnteredBy     Debit     sts.schoolid
    caiu, test      204     1     
    QUERY:
    SELECT lastfirst,EnteredBy,Debit,schoolid FROM students sts JOIN GLDetail gl ON gl.studentid=sts.id
    RESULT SET:
    NONE
    Therefore, I have to have something written incorrectly in my php code and I just can not figure it out. My entire code is pasted below please provide me with an assistance you might have to offer. I have change the odbc_connec line so I could post it to this forum. In addition, I had to phrase out the column headers there for when you write the column headers you have to use ~ instead of , as the separator and then I turn back into the correct format for sql.
    //These scripts just open help windows if somone clicks on the icon
    <script>
    function submit()
    {document.sqlform.submit();}
    </script>
    <script>
    function colwin(){
    window.open("colnames.php",null,"height=300,width=400,scrollbars=1");}
    </script>
    <script>
    function tabwin(){
    window.open("tablenames.php",null,"height=300,width=400,scrollbars=1");}
    </script>
    <script>
    function help(){
    window.open("http://www.w3schools.com/sql/default.asp",null,"height=500,width=700,scrollbars=1");}
    </script>
    <form method="post" action="<?php echo $PHP_SELF;?>" name="sqlform">
    <?php
    //Cookie to check for authorization to the site
    if($_COOKIE['cookie']=="CheckCookieForAuth")
    //These get the values of the textareas after the form has been submitted
    $sqlSELECT = $_POST["SELECT"];
    $sqlFROM = $_POST["FROM"];
    $sqlJOIN = $_POST["JOIN"];
    $sqlWHERE = $_POST["WHERE"];
    $sqlOTHER = $_POST["OTHER"];
    $sqlSELECTTYPE = $_POST["SELECTTYPE"];
    //This is the variable used to parse out my headers the user entered
    $sqlColNames = split('~',$sqlSELECT);
    //This converts the ~ separator to , so I can actually use it as part of my sql string
    $search = array('~');
    $replace = array(',');
    $mystring = $sqlSELECT;
    $sqlString = str_replace($search, $replace, $mystring);
    //These are the textareas and the drop down options that the end users has to create queries
    echo "<table border=0>";
    echo "<tr><td valign='top'>";
    echo "<B>SELECT TYPE</B> <BR><SELECT NAME=SELECTTYPE>
    <OPTION VALUE='SELECT' SELECTED>SELECT</OPTION>
    <OPTION VALUE='SELECT DISTINCT'>SELECT DISTINCT</OPTION>
    <OPTION VALUE='INSERT'>INSERT</OPTION>
    <OPTION VALUE='UPDATE'>UPDATE</OPTION>
    <OPTION VALUE='DELETE'>DELETE</OPTION>
    </SELECT>";
    echo "</td><td>";
    echo "<textarea rows=2 cols=75 name=SELECT wrap=physical>$sqlSELECT</textarea>";
    echo "</td><td valign='top'>";
    echo "<img src='images/sqlC.jpg' width='25' height='25' onclick='colwin()'>";
    echo "</td></tr>";
    echo "<tr><td valign='top'>";
    echo "<b>FROM</b>";
    echo "</td><td>";
    echo "<textarea rows=2 cols=75 name=FROM wrap=physical>$sqlFROM</textarea>";
    echo "</td><td valign='top'>";
    echo "<img src='images/sqlT.jpg' width='25' height='25' border=0 onclick='tabwin()'>";
    echo "</td></tr>";
    echo "<tr><td valign='top'>";
    echo "<b>JOIN</b>";
    echo "</td><td>";
    echo "<textarea rows=2 cols=75 name=JOIN wrap=physical>$sqlJOIN</textarea>";
    echo "</td></tr>";
    echo "<tr><td valign='top'>";
    echo "<b>WHERE</b>";
    echo "</td><td>";
    echo "<textarea rows=2 cols=75 name=WHERE wrap=physical>$sqlWHERE</textarea>";
    echo "</td></tr>";
    //This is where the end user would enter group by, having, order by, etc..
    echo "<tr><td valign='top'>";
    echo "<b>OTHER</b>";
    echo "</td><td>";
    echo "<textarea rows=2 cols=75 name=OTHER wrap=physical>$sqlOTHER</textarea>";
    echo "</td></tr>";
    This is a run query icon and a help icon
    echo "<tr><td colspan=2 align=right>";
    echo "<img src='images/RunQuery.jpg' width='30' height='28' onclick='submit()'> <img src='images/qm.jpg' border=0 width='25' height='25' onclick='help()'>";
    echo "</td></tr></table>";
    echo "<br>";
    echo "<br>";
    //This is where I connect to my remote oracle database
         $conn=odbc_connect('ODBC_ConnectionName','USERNAME','PASSWORD');
    //This is the sql string created by the end users
         $sql="$sqlSELECTTYPE $sqlString FROM $sqlFROM $sqlJOIN $sqlWHERE $sqlOTHER";
    //This executes the connection string and the sql string
         $rs=odbc_exec($conn,$sql);
    //This will display the query or a message if the query is empty
         if($rs!=NULL){
         echo "<table border=1>";
         echo "<tr>";
    //This loops through the string array the end user enter the field name text area to get column headers
         for($i=0; $i<count($sqlColNames); $i++)
         echo "<td>";
         print_r($sqlColNames[$i]);
         echo "</td>";
         echo "</tr><tr>";
    //This actually fetchs the rows from the statement and then display the data based on the column names the end user speificed
         while (odbc_fetch_row($rs))
              for($i=0; $i<count($sqlColNames); $i++)
                   $results=odbc_result($rs,$sqlColNames[$i]);
                   echo "<td>$results</td>";
              echo "</tr>";
         odbc_close($conn);
         echo "</table>";}else{echo "Results will be displayed here";}
    echo "<br><br>";
    echo $sql;
    else
    echo "Not logged in";
    ?>
    </form>

    This looks more like a SQL question than a PHP issue. There are a couple of JOIN examples at http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_10002.htm#i2066611 that might you work through the problem.

  • Email or store submitted PDF form using PHP

    I'm using LiveCycle Designer 8.0. I've searched a lot but haven't seen any answers or solutions to submitting the filled out pdf form online and the pdf sending to an email without it having to use an email client on the users computer.
    I'd prefer to use php and either save to the server or directly send the pdf as an attachment using the php mail() function. Any language would be fine, I'm just experienced with php.
    If anyone would have a solution to this, I am fully capable of editing scripting to send the correct fields for my particular form. I've just not been able to find a way to store and attach in pdf format. Since the LiveCycle has the built-in function to open your default mail client, attach the pdf, and then send - isn't there some way that function could be edited to use the servers php mail feature instead?
    Any help would be greatly appreciated. The reason this has become so important is that the new systems at some doctor's offices are requiring pdf's sent in advance that save in a program that allows the use of digital pen signing (like when you sign for a fedex package) of the documents once the patient arrives. And unfortunately, still many of the patients are not going to be avid pc users and will not have an email client program like outlook set up.
    Thanks much,
    Heather

    Thank you for your answer. I completely understand how to do all the things you mention, have been able to do them - where I can't seem to understand is posting to the web server. Maybe it's just simple and I'm overthinking it. When I set a url to post to, I've been trying to use a php script, but can't get the call right to save or grab the pdf.
    Could you help me with that part? Are you meaning it that way - to post it to a script or am I over-doing it and there's a simpler way?
    I appreciate your help very much.
    Heather

  • Php and asp on same server?

    Just a quicky?
    Can I run both php and asp on the same server?
    Some one has a website produced using asp (don't know a thing about that language) but I'd like to use the server it's on and redo some of the stuff using php just retaining a few pages which use asp, possible or not?
    Cheers
    Os

    pziecina wrote:
    Hi
    Yes, you can do this, (just not on the same page). I would recommend checking with your server provider first though.
    PZ
    Sounds promising:)
    Nope, I don't want to mix and match on the same page. There's a couple of pages that I probably don't have the experience to do so I can just give them a visual makeover but retain the asp part.
    Thanks
    Os

  • CS3 mysql database connection using php

    Hi, this is my first time trying to connect to a database.  I have created a mysql database with my hosting provider.  I am also configured to use php. I have ready numerous threads on this topic, but am still confused.
    I am getting the following error message:
    When I enter the following information into the connection string, I get the following error Error http error code 404 file not found. The site does not map to ftp.readyhosting.com/_mmserverscripts/mmhttdb.php Is the location of mysql server correct? Connection name ? user defined ?aosprod?
    Mysql server = aoswebeditor.readyhostingmysql.com.  Also, this is not the same location as the web server. 
    The hosting company provides the following php code to connect to the database. 
    <?php
    $link = mysql_connect('aoswebeditor.readyhostingmysql.com', 'aosweb', '*password*');
    if (!$link) {
        die('Could not connect: ' . mysql_error());
    echo 'Connected successfully';
    mysql_select_db(aos);
    ?>
    Because of the connection dialog boxes in CS3, I have not used this php code but only used the mysql server aoswebeditor.readyhostingmysql.com.
    My requirements are very simple, I want to use the same remote database for the dreamweaver connection for the remote and testing server.
    Any ideas would be appreciated.
    Thanks. George

    First of all, you seem to be mixed up about terminology. ASP stands for Active Server Pages, and is a type of server technology similar to PHP. I think you mean ISP (Internet Service Provider). However, this is not correct, either. An ISP provides your connection to the internet. Although some ISPs also host websites for their customers, your website is normally located at a hosting company. You need to get that mixup out of the way. Otherwise, you might confuse people with future questions about ASP, when you actually mean something completely different.
    OK, lecture over...
    Your hosting company is following standard procedure by preventing remote access to MySQL databases. However, Dreamweaver does make it possible to use your remote database and website for testing purposes. It does so by uploading a hidden folder called _mmServerScripts to your remote server. This performs a local connection with your database, and then sends the results back to your local computer. When setting up your testing server definition in Dreamweaver, you need to provide the details as I indicated before. When creating a MySQL connection in Dreamweaver, fill in the server name and account details as given to you by your hosting company. If everything is set up correctly, you should be able to use your remote server and database for testing.
    Having said that, it is much better to install a local testing environment. You'll find it faster, and it also lets you make mistakes (an essential part of the learning process) in the security of a closed environment. For details of how to set up a local testing environment, see this article in the Adobe Developer Connection.

  • How use PHP to read image files from a folder and display them in Flex 3 tilelist.

    Hello. I need help on displaying images from a folder dynamically using PHP and display it on FLEX 3 TileList. Im currently able to read the image files from the folder but i don't know how to display them in the TileList. This is my current code
    PHP :
    PHP Code:
    <?php
    //Open images directory
    $imglist = '';
    $dir = dir("C:\Documents and Settings\april09mpsip\My Documents\Flex Builder 3\PHPTEST\src\Assets\images");
    //List files in images directory
    while (($file = $dir->read()) !== false)
    if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
    echo "filename: " . $file . "\n";
    $dir->close();
    ?>
    FLEX 3 :
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="pic.send();">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    import mx.rpc.events.FaultEvent;
    import mx.events.ItemClickEvent;
    import mx.rpc.events.ResultEvent;
    public var image:Object;
    private function resultHandler(event:ResultEvent):void
    image = (event.result);
    ta1.text = String(event.result);
    private function faultHandler(event:FaultEvent):void
    ta1.text = "Fault Response from HTTPService call:\n ";
    ]]>
    </mx:Script>
    <mx:TileList x="31" y="22" initialize="init();" dataProvider = "{image}" width="630" height="149"/>
    <mx:String id="phpPicture">http://localhost/php/Picture.php</mx:String>
    <mx:HTTPService id="pic" url="{phpPicture}" method="POST"
    result="{resultHandler(event)}" fault="{faultHandler(event)}"/>
    <mx:TextArea x="136" y="325" width="182" height="221" id="ta1" editable="false"/>
    <mx:Label x="136" y="297" text="List of files in the folder" width="182" height="20" fontWeight="bold" fontSize="13"/>
    </mx:Application>
    Thanks. Need help as soon as possbile. URGENT.

    i have made some changes, in the php part too, and following is the resulting code( i tried it, and found that it works.):
    PHP Code:
    <?php
    echo '<?xml version="1.0" encoding="utf-8"?>';
    ?>
    <root>
    <images>
    <?php
    //Open images directory
    $dir = dir("images");
    //List files in images directory
    while (($file = $dir->read()) !== false)
    if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
    echo "<image>" . $file . "</image>"; // i expect you to use the relative path in $dir, not C:\..........
    //$dir->close();
    ?>
    </images>
    </root>
    Flex Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
    creationComplete="callPHP();">
    <mx:Script>
    <![CDATA[
    import mx.rpc.http.HTTPService;
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    import mx.rpc.events.FaultEvent;
    import mx.events.ItemClickEvent;
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    private var arr:ArrayCollection = new ArrayCollection();
    private function callPHP():void
    var hs:HTTPService = new HTTPService();
    hs.url = 'Picture.php';
    hs.addEventListener( ResultEvent.RESULT, resultHandler );
    hs.addEventListener( FaultEvent.FAULT, faultHandler )
    hs.send();
    private function resultHandler( event:ResultEvent ):void
    arr = event.result.root.images.image as ArrayCollection;
    private function faultHandler( event:FaultEvent ):void
    Alert.show( "Fault Response from HTTPService call:\n " );
    ]]>
    </mx:Script>
    <mx:TileList id="tilelist"
    dataProvider="{arr}">
    <mx:itemRenderer>
    <mx:Component>
    <mx:Image source="images/{data}" />
    </mx:Component>
    </mx:itemRenderer>
    </mx:TileList>
    </mx:Application>

  • How to use Php a function in an insert transaction ?

    Hi,
    I want to insert a computed data (string) based on a date (dd-mm-aaaa hh:mm:ss).
    The result must be AAAAMM Year+month without spaces.
    So i tried this :
    $ins_agenda->addColumn("aaaa_mm", "string", "POST", "date({date_debut_effective},'Ym')");
    But it failed.
    Is it possible to use Php fonction with an appropriated syntax ?
    Thanks for your help. JM.

    I get this :
    tNG_fields.getColumnValue:
    Column date_debut_effective is not part of the current transaction
    In fact, date_debut_effective is the form field name, deb_eve is the database field name (transaction name).
    aaaa_mm is another database field in the same table, same transaction.
    aaaa_mm should only be computed with deb_eve data.
    When I use deb_eve as transaction field name in the trigger, the targeted database field (aaaa_mm) remain empty after the insert.
    The logic should like this :
    Form field (format datetime)
    -> database X field deb_eve (same format datetime)
    -> computed database X field aaaa_mm (format aaaamm or Ym)
    I use this : $ins_agenda_previsionnel->addColumn("aaaa_mm", "STRING_TYPE", "CURRVAL", ""); to fill aaaa_mm field.
    My code :
    before trigger
    // date de début effective vers date aaaamm
    function Trigger_Custom_aaaamm(&$tNG) {
    $date_field = $tNG->getColumnValue(deb_eve);
    $tNG->setColumnValue("aaaa_mm", date($date_field,'Ym') );
    insert transaction
    // Make an insert transaction instance
    $ins_agenda_previsionnel = new tNG_insert($conn_cnxWarh);
    $tNGs->addTransaction($ins_agenda_previsionnel);
    // Register triggers
    $ins_agenda_previsionnel->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "");
    $ins_agenda_previsionnel->registerTrigger("BEFORE", "Trigger_Custom_aaaamm", 98);
    $ins_agenda_previsionnel->registerTrigger("AFTER", "Trigger_LinkTransactions3", 98);
    $ins_agenda_previsionnel->registerTrigger("ERROR", "Trigger_LinkTransactions3", 98); //liste IRP
    // Add columns
    $ins_agenda_previsionnel->setTable("agenda_previsionnel");
    $ins_agenda_previsionnel->addColumn("id_agent", "NUMERIC_TYPE", "VALUE", "{rsfiche_agent.id_agent}");
    $ins_agenda_previsionnel->addColumn("aaaa_mm", "STRING_TYPE", "CURRVAL", "");
    $ins_agenda_previsionnel->addColumn("titre", "STRING_TYPE", "VALUE", "ENTREE AGENT");
    $ins_agenda_previsionnel->addColumn("evenement", "STRING_TYPE", "VALUE", "Entrée Agent {Vue_Visu.prenom} {Vue_Visu.nom_complet} ");
    $ins_agenda_previsionnel->addColumn("deb_eve", "DATE_TYPE", "POST", "date_debut_effective");
    $ins_agenda_previsionnel->addColumn("fin_eve", "DATE_TYPE", "VALUE", "{Vue_Visu.date_fin_contrat}");
    $ins_agenda_previsionnel->addColumn("frequence", "STRING_TYPE", "VALUE", "1");
    $ins_agenda_previsionnel->setPrimaryKey("id_agenda", "NUMERIC_TYPE");

  • Using PHP files in Dreamweaver?

    When I create a new PHP file in Dreamweaver the code is the same as an HTML file, shouldn't be different? with php commands or something?
    Thanks

    When I create a new PHP file in Dreamweaver the code is the same as an HTML file, shouldn't be different? with php commands or something?
    Not unless you add them.  PHP is a server-side programming language.  PHP web pages are no different than HTML pages except that they can parse data on the server.  With the right include statements or commands, PHP or ASP pages can publish information from server-side databases to form a dynamically driven web site.
    BUILDING DYNAMIC SITES in DW
    Set up a local testing server in Adobe Dreamweaver CS4
    http://www.adobe.com/newsletters/edge/december2009/articles/article2/index.html
    Setting up a PHP development environment for Dreamweaver
    http://www.adobe.com/devnet/dreamweaver/articles/setting_up_php_05.html
    Building your first dynamic website – Part 1: Setting up your site and database connection
    http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt1.html
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb
    http://alt-web.blogspot.com

  • PLEASE help with server-side form validation using PHP!!!

    I feel like im going round and round in circles with this, after looking into all sorts of server-side advice i've come to the conclusion that i want to validate my form using server-side validation with PHP.
    So my form has several drop down menu's and  textareas  (not all of them need validation). For the part of my form i would like to validate, all i want is the drop downs to have to be changed/selected. So just a simple message like "You must select an option" if customers haven't done so. For the textareas, they just need to be filled out, so a message like "Information required" to come up if customers haven't done so.
    I believe i need to create a PHP page say for example 'error.php' place  the validation code in there and set this part of the the form to -
    <form name="product"form action="error.php" method="post" class="product_form">
    BUT im getting really confused with creating the code for the error.php. Please please can anyone help me with this!!!???
    Here are the drop down menu's i need validation on, error message being "You must select an option",
    "figurine"
    "engraving"
    "font"
    and here are the textareas that need validating, error message "Information required",
    "test"
    "Name"
    "house"
    "line_1"
    "line_2"
    "county"
    "postcode"
    "tel"
    www.milesmemorials.com/product-GK1.html
    I'd really appreciate any help!!!

    Ness_quick wrote:
    Great thats good enough for me. In that case, would you please be able to help me create the javascript for the above validation?? If you could just help me create it for this page i can amend it for all the other pages. I'd really really appreciate it!!!
    Can you follow the below example?? Obviously AFTER validation has been successful you need to collect the information from the form and send it to the recipient email address...that's where you can use php. I'll check back tomorrow and see how you are doing.
    <!DOCTYPE HTML>
    <html><head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Form validation</title>
    <!-- VALIDATE ORDER FORM  -->
    <script type="text/javascript">
    <!--
    function RequiredFormFields() {
        // inform customer to provide figurine choice
    var figurine = document.forms.product.figurine.value;
    if (figurine == "-- Select figurine --")
    alert("Please provide figurine choice");
    return false;
    // inform customer to provide engraving choice
    var engraving = document.forms.product.engraving.value;
    if (engraving == "-- Select engraving --")
    alert("Please provide engraving choice");
    return false;
    // inform customer to provide font choice
        var font = document.forms.product.font.value;
    if (font == "-- Select style --")
    alert("Please select font style");
    return false;
    // inform customer to provide their name
    var Name = document.forms.product.Name.value;
    if (Name == null || Name == "")
    alert("Please provide your name");
    return false;
    // inform customer to provide their house number/name
    var house = document.forms.product.house.value;
    if (house == null || house == "")
    alert("Please provide your house number/name");
    return false;
    } // end function
    -->
    </script>
    </head>
    <body>
    <form name="product" form action="processForm.php" method="post" class="product_form" onsubmit="return RequiredFormFields()">
    <p class="product_form_options">Choice of Figurine<br>
    <select name="figurine" class="productButton" id="figurine" onChange="Recalculate()">
    <option selected>-- Select figurine --</option>
    <option value="7031">Tropical Green Granite with bronze sacred heart figurine as pictured(&pound;7031)</option>
    <option value="5216">Tropical Green Granite with bronze effect sacred heart figurine (&pound;5216)</option>
    <option value="5216">Tropical Green Granite with reconstituded figurine MF122(&pound;5216)</option>
    </select>
    </p>
    <p class="product_form_options">Engraved Lettering<br>
    <select name="engraving" class="productButton" id="engraving" onChange="Recalculate()">
            <option selected>-- Select engraving --</option>
            <option value="2.30">Sandblast and enamel painted (&pound;2.30/letter)</option>
            <option value="2.80">Sandblast and guilded (&pound;2.80/letter)</option>
            <option value="2.20">Maintenance free (&pound;2.20/letter)</option>
            <option value="3.73">Traditionally hand cut and enamel painted (&pound;3.73/letter)</option>
            <option value="3.98">Traditionally hand cut and gilded (&pound;3.98/letter)</option>
            <option value="4.34">Raised lead and enamel painted (&pound;4.34/letter)</option>
            <option value="4.59">Raised lead and gilded (&pound;4.59/letter)</option>
          </select>
    </p>
    <p class="product_form_options">Letter/Font Style<br>    
          <select name="font" class="productButton" id="font" >
               <option selected>-- Select style --</option>
               <option value="Maintenance free">Maintenance free </option>
               <option value="White painted block">White painted block</option>
               <option value="White painted roman">White painted roman</option>
               <option value="White painted Script">White painted Script</option>
               <option value="White painted Celtic">White painted Celtic</option>
               <option value="White painted Nova">White painted Nova</option>
               <option value="Sliver painted block">Sliver painted block</option>
               <option value="Sliver painted roman">Sliver painted roman</option>
               <option value="Sliver painted Script">Sliver painted Script</option>
               <option value="Sliver painted Celtic">Sliver painted Celtic</option>
               <option value="Sliver painted Nova">Sliver painted Nova</option>
               <option value="Gold leaf painted block">Gold leaf painted block</option>
               <option value="Gold leaf painted roman">Gold leaf painted roman</option>
               <option value="Gold leaf painted Script">Gold leaf painted Script</option>
               <option value="Gold leaf painted Celtic">Gold leaf painted Celtic</option>
               <option value="Gold leaf painted Nova">Gold leaf painted Nova</option>
               <option value="Gold leaf painted Old English">Gold leaf painted Old English</option>
             </select>
             </p>
             <p>
    <p>Name<br>
    <input name="Name" type="text" id="Name" value="">
    </p>
    <p>House name or number:<br>
    <input name="house" type="text" id="house" size="67">
    </p>
    <p>
    <input name="submit" type="submit" class="place_order" id="submit" value="Place order">
    </p>  
    </form>
    </body>
    </html>

Maybe you are looking for