Dwt.php  help

Hi,
I've been desiging a new layout in PHP, and have it about
ready. So now I need to create a template for others can put
content into pages using this new layout.
The .php page I first created, I can F12 and it opens the
browser and looks fine.
but now I'm trying to create this template, if I F12 I get
this error in the template, and any pages that use the template.
Fatal error: Call to undefined function virtual() in
D:\wwwroot\testsite\TMPwyy956vucx.php on line 443
The error goes away if I don't include any files in the
template?
I'm trying to include another .php file (which are my menus)
These files only contain the menu lists, nothing else.
What would cause this?
Not sure what the difference is between the .php I created
for the layout, and the .dwt.php I'm trying to develop?

I think that this include type is the problem.
<?php virtual('/includes/test_include.php'); ?>
Change it to this -
<?php include('../includes/test_include.php'); ?>
and see what happens. You really wouldn't need to use a
virtual link to
these include files. DW knows how to manage them.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"cdoyle" <[email protected]> wrote in
message
news:ga3kr4$8dq$[email protected]..
> Here is the code to a test dwt.php I made, all it has is
the include.
> As soon as the include is put on the page, it comes back
with that error.
>
> Yes I'm pretty sure that the testing server is setup
right, I was able to
> use
> it when I created the first .php page from scratch. I
was able to preview
> (F12) and everything looks fine, and that page also had
the includes.
>
>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
> "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="
http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
> <!-- TemplateBeginEditable name="doctitle" -->
> <title>Untitled Document</title>
> <!-- TemplateEndEditable -->
> <!-- TemplateBeginEditable name="head" -->
> <!-- TemplateEndEditable -->
> </head>
>
> <body>
> <?php virtual('/includes/test_include.php'); ?>
>
> </body>
> </html>
>

Similar Messages

  • Dw Templates - .dwt.php & Movie not loaded

    Hi,
    I'm in the middle of converting an existing website to .dwt for use with Contribute. All is going well, I have my editable regions working and my templates folder in the correct place.
    I've run into a few problems, the primary one being Flash.
    Dw is saving the templates as filename.dwt.php. They do function as you'd expect .dwt to function, but I can't find a reason for it doing this. Is this because they need to be .php files themselves to correctly use the code, or is this a setting I have somewhere? I've searched but I can't see details on this. Will this cause problems?
    Dw would connect to the root domain, but not to the host directory (not the first time it has happened, I swear it doesn't like me). I've double checked permissions and logins, but it keeps throwing a permissions/directory doesn't exist error. This is not a problem as such as I can browse to it from the root, but I thought it may have some impact on the following problem. It is definitely affecting the check in/check out functionality, but for setup this is tolerable. If anyone knows reasons why or how to fix it, I'd love to know.
    I had the files running on a local WAMP server. The template is *perfect*, exactly what I want the page/s based on it to look like. (Dw does throw a notification about placing editable regions inside a block level element and that meaning that users cannot create new blocks, which is fine by me, but might have some bearing?). In uneditable regions of the template there are two separate .swf files. When I view the template page, the files are visible and play as they are supposed to. When I view the page created from this template on the WAMP server, these areas collapse. When I view this page on the live test server, the areas are the correct size, but the movies do not play. A right click shows a greyed out notification of "movie not loaded". The page source shows that the links are relative and pointing to the correct place. The spry assets on the same page do load, all the other links work (relative), and I have checked that the .swf files are indeed on the server, working, and in the correct location. What could be causing the template-based page to malfunction like this? Am I missing something simple?
    Any help with this would be greatly appreciated. This is my first time converting to templates and trying to get a site ready for Contribute and I would like to get a better understanding of why it is doing what it is doing. I've been going around in circles for hours and could really use a couple more heads on the matter.
    Cheers,
    Abbey

    Hi Bob.
    Yes, I am 100% sure; have just checked again. I cannot even
    get it to work
    on my local machine.
    Where alse can I start looking for?
    I am really desperate.
    Regards,
    Deon
    "Bob Pierce" <[email protected]> wrote in
    news:fulj1k$9t5$1
    @forums.macromedia.com:
    > Are you sure that the .swf was uploaded to your server?
    >

  • If I have a temp1.dwt.php with 60 files on it and one editable region, how apply to this template a

    if I have a temp1.dwt.php with 60 files on it and one editable region, how apply to this template a new temp2.dwt.php with same one editable region same place, without need to create new files and copy / paste editable region contents???
    eg I have a 3-region layout(template) with one editable region with html tables and want to convert it to:
    3-region layout(template) with one editable region with DIVs
    editable region contents all files remain the same...
    well?
    dw cs6 and dw cs4

    Name your editable regions the same in the new template as they were named in the existing one.
    Look at the code in the old template.  Find all regions like this -
    <!-- TemplateBeginEditable name="whatever" -->
    Make note of the name.  Ensure that all corresponding regions in the new template have the same name as they did in the old template.
    Then do a site-wide Find and Replace to find the old template's file name, and replace it with the new template's file name.
    if the old template is templ.dwt and new templ.dwt.php???
    Find SITE-WIDE "templ.dwt" and replace with "templ.dwt.php".

  • Change my dwt to dwt.php and update child pages

    Hello,
    I need to convert my dwt to php. My site is not that big at this time so I can manually change the links and extensions on the child pages if needed. How do I convert the template and assure it stays attached to the child pages? As a test, I used "save as" and saved the template as mytemplate. dwt.php. I edited a region of the template and saved. The content of the child pages didnt update at all. They dont seem to be attached.
    Thanks so much,
    Andrea

    Hi Murray,
    Method 3 worked like a charm and saved a lot of time. Can I ask you an off topic question?  I uploaded my site and things were good with current browsers I was shocked when I pulled up my website on an old pc with IE6.  I really wish I hadn’t looked!  Many images are very large, distorted, and misplaced.  One example occurs in a div with the following class:
    .form_container{
                    max-width: 400px;
                    height: auto;
                    background-color: #FFF;
                    margin-left: auto;
                    margin-right: auto;
                    border-radius: 20px;
                    padding-top: 10px;
                    padding-bottom: 10px;
    I checked the properties. The image only has one class  .form_container.  New browsers display the image it’s actual 125px size, but IE6 stretches it to 100% of the div size.  Looking at the css, I see did not specify any image properties.   I have this problem with images all over the site.  What is the most effective way to solve it? 
    Thanks
    Andrea

  • ZEND/Flex - amf-config.php help!!

    Have some odd behavior taking place when promoting release builds to my production server.
    I have two projects one works - one does not. Both the same settings as far as I can tell.
    Using the amf-config.ini file - this test works
    [zend]
    ;set the absolute location path of webroot directory, example:
    ;Windows: C:\apache\www
    ;MAC/UNIX: /user/apache/www
    ;webroot =C:/Program Files/Zend/Apache2/htdocs
    webroot = ../../
    ;set the absolute location path of zend installation directory, example:
    ;Windows: C:\apache\PHPFrameworks\ZendFramework
    ;MAC/UNIX: /user/apache/PHPFrameworks/ZendFramework
    ;zend_path =
    [zendamf]
    amf.production = false
    amf.directories[]=xyz/release/services
    The next release uses the same gateway and amf-config files - and I get this error.
    Class "XYZservice" does not exist: Plugin by name 'XYZservice' was not found in the registry; used paths: : /xyz/release/services/
    #0 /var/www/vhosts/xyz.com/httpdocs/ZendFramework/library/Zend/Amf/Server.php(550): Zend_Amf_Server->_dispatch('secure', Array, 'XYZservice')
    #1 /var/www/vhosts/xyz.com/httpdocs/ZendFramework/library/Zend/Amf/Server.php(626): Zend_Amf_Server->_handle(Object(Zend_Amf_Request_Http))
    #2 /var/www/vhosts/xyz.com/httpdocs/xyz/release/gateway.php(69): Zend_Amf_Server->handle()
    #3 {main}
    Have tried many variations - but still no joy. Why does ../../ work and not the direct path? - by the look of it, those directory's are fine.
    As I understand it - no matter what set-up you build on (local Windows) and promote to a hosted production server (US, mediatemple) - as long as you configure the amf-config.ini file all should be good. Is this the case? Am I missing something when I do a release build.
    Am I better of specifying the "endpoint" in all my service calls in my declarations (mxml code)?
    Been going round in circles with this for several months now. Getting to the point where the only way I can deploy is Windows. DO NOT want to go down that road.
    Help is much appreciated.
    rgds
    martin

    6 Hours of headache later I solved this problem!
    So in my case the amf_config.ini was set up correctly with webroot=/fullpath/to/url/root and amf.service=foldername (php in my case)
    on my local machine the services file is product.php and everything is groovy and working
    I uploaded everything exactly as it is on my machine and got the error you did.
    I simply cp product.php to Product.php and it worked
    For somereason the zend framework is looking for a file that starts with a capital letter!!!! even though it works fine on my machine and was referenced as product.php! Are you kidding me? What a headache.
    Joel

  • MySQL & PHP -- Help!

    Hi guys,
    Long time, no see! ;-)
    Anyway, I've got a question for someone who is pretty darn
    good with PHP,
    forms, and MySQL. This is ultimately what I need to achieve:
    I'm creating a webpage for my university that will allow the
    professors in
    the IST department to select their preferences in course
    choices. I want to
    list out each IST course and then give them two different
    things to do with
    each course. The first thing is they need to select if
    they've taught that
    IST course before. Secondly, they need to say whether they
    "don't want to
    teach" the course, are "willing to teach" the course, or
    "really want to
    teach" the course. OK, hope this makes sense so far. What I
    need help with
    is figuring out how to put all the choices for each categorey
    into one field
    in a MySQL database. For example, if they selected the "don't
    want to teach"
    option (I'm not sure if a drop-box or radio button would work
    best...) for
    IST 215, IST 110 and IST 230. How can I have those courses
    entered into the
    single database field called "dontwant?"
    This is my code so far:
    // Connect to server and select database.
    mysql_connect("$host", "$username", "$password")or
    die("cannot connect");
    mysql_select_db("$db_name")or die("cannot select DB");
    // Get values from form
    $name=$_POST['name'];
    $thedate=date('m-j-y');
    $taughtbefore=;
    $dontwant=;
    $willing=;
    $reallywant=;
    $comments=!trim($_POST['comments']);
    // Insert data into mysql
    $sql="INSERT INTO $tbl_name(name, thedate, taughtbefore,
    dontwant,
    willing, reallywant, comments)VALUES('$name', '$thedate',
    '$taughtbefore',
    '$dontwant', '$willing', '$reallywant', '$comments')";
    $result=mysql_query($sql);
    // close connection
    mysql_close();
    Is there a way I can like...append all these values into one
    string to pass
    into the single database field...? As you can see, I really
    don't know how
    or what values to assign to those empty strings up there...
    I'm really
    unsure of how to go about doing this. I hope this makes
    sense...
    Thanks for any and all of your time!
    Shane H
    [email protected]
    http://www.avenuedesigners.com
    =============================================
    Blog:
    http://avenuedesigners.com/blog/
    Web dev articles, photography, and more:
    http://sourtea.com
    =============================================
    Proud GAWDS member
    http://www.gawds.org/showmember.php?memberid=1495
    Delivering accessible websites to all ...
    =============================================

    Hi Murray,
    Allow me to clarify. I ultimately need to display something
    like this...and
    this would be reading from the MySQL database, and output in
    a table on the
    webpage:
    | No Teach | Want to Teach | Really want |
    | IST 250 | IST 420 | IST 330 |
    | IST 110 | IST 101 | IST 311 |
    | IST 332 | | IST 120 |
    | | | IST 440
    |
    I understand your approach and think it's a good idea. I
    guess I should have
    a table for each, like: NoTeach, WantToTeach, and ReallyWant.
    My question is
    how I would put the right IST course into the right table.
    Like if they
    selected "I don't want to teach" would I have some type of if
    statement to
    sort them into the right tables? If so, can you give me some
    code on how it
    would work?
    Thanks!
    Shane H
    [email protected]
    http://www.avenuedesigners.com
    =============================================
    Blog:
    http://avenuedesigners.com/blog/
    Web dev articles, photography, and more:
    http://sourtea.com
    =============================================
    Proud GAWDS member
    http://www.gawds.org/showmember.php?memberid=1495
    Delivering accessible websites to all ...
    =============================================
    "Murray *ACE*" <[email protected]> wrote
    in message
    news:[email protected]...
    > Why would you want to put all of that into a single
    field? Sounds like
    > the wrong approach to me....
    >
    > I'd have a NoTeach table, containing at least three
    fields -
    >
    > termDate
    > profID
    > classID
    >
    > Each professor's "noteach" selection would then be a
    separate record in
    > that table, which could all be collated for display....
    >
    > --
    > Murray --- ICQ 71997575
    > Adobe Community Expert
    > (If you *MUST* email me, don't LAUGH when you do so!)
    > ==================
    >
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    > ==================
    >
    >
    > "Shane H" <[email protected]> wrote
    in message
    > news:[email protected]...
    >> Hi guys,
    >>
    >> Long time, no see! ;-)
    >>
    >> Anyway, I've got a question for someone who is
    pretty darn good with PHP,
    >> forms, and MySQL. This is ultimately what I need to
    achieve:
    >>
    >> I'm creating a webpage for my university that will
    allow the professors
    >> in the IST department to select their preferences in
    course choices. I
    >> want to list out each IST course and then give them
    two different things
    >> to do with each course. The first thing is they need
    to select if they've
    >> taught that IST course before. Secondly, they need
    to say whether they
    >> "don't want to teach" the course, are "willing to
    teach" the course, or
    >> "really want to teach" the course. OK, hope this
    makes sense so far. What
    >> I need help with is figuring out how to put all the
    choices for each
    >> categorey into one field in a MySQL database. For
    example, if they
    >> selected the "don't want to teach" option (I'm not
    sure if a drop-box or
    >> radio button would work best...) for IST 215, IST
    110 and IST 230. How
    >> can I have those courses entered into the single
    database field called
    >> "dontwant?"
    >>
    >> This is my code so far:
    >>
    >> // Connect to server and select database.
    >> mysql_connect("$host", "$username", "$password")or
    die("cannot
    >> connect");
    >> mysql_select_db("$db_name")or die("cannot select
    DB");
    >>
    >> // Get values from form
    >> $name=$_POST['name'];
    >> $thedate=date('m-j-y');
    >> $taughtbefore=;
    >> $dontwant=;
    >> $willing=;
    >> $reallywant=;
    >> $comments=!trim($_POST['comments']);
    >>
    >> // Insert data into mysql
    >> $sql="INSERT INTO $tbl_name(name, thedate,
    taughtbefore, dontwant,
    >> willing, reallywant, comments)VALUES('$name',
    '$thedate',
    >> '$taughtbefore', '$dontwant', '$willing',
    '$reallywant', '$comments')";
    >> $result=mysql_query($sql);
    >>
    >> // close connection
    >> mysql_close();
    >>
    >>
    >> Is there a way I can like...append all these values
    into one string to
    >> pass into the single database field...? As you can
    see, I really don't
    >> know how or what values to assign to those empty
    strings up there... I'm
    >> really unsure of how to go about doing this. I hope
    this makes sense...
    >>
    >> Thanks for any and all of your time!
    >>
    >>
    >> --
    >> Shane H
    >> [email protected]
    >>
    http://www.avenuedesigners.com
    >>
    >> =============================================
    >> Blog:
    >>
    http://avenuedesigners.com/blog/
    >>
    >> Web dev articles, photography, and more:
    >>
    http://sourtea.com
    >> =============================================
    >> Proud GAWDS member
    >>
    http://www.gawds.org/showmember.php?memberid=1495
    >>
    >> Delivering accessible websites to all ...
    >> =============================================
    >

  • Php Help

    I have a site I have developed with Dreamweaver 8. The site
    has a mix of pages - some with the .html and some with the .php. So
    far everything works great. My home page was .html but I saved it
    over to .php and updated all the links (Dreamweaver did all of this
    for me). Now, I want to use some php code for a news feed. However,
    I keep getting the following two errors:
    Warning: main(): URL file-access is disabled in the server
    configuration in /home/content/s/u/s/sl/html/BMT/index.php on line
    139
    Warning: main(
    http://www.newsfeed.com/tools/steppatch_nc.asp?type=s&t=test&prov=keywords&cat=Business&ca t2=&num_articles=5&show_summaries=Yes&show_sources=No&show_dates=No&title=undefined&keywor ds=B%20Lns&url=&headers_size=12pt&title_size=10pt&title_bold=Yes&font_size=10pt&font_famil y=Arial&text_alignment=Left&space=Yes&titlecolor=%23000000&fcolor=%23000000&desccolor=%230 00000&sourcecolor=%230000FF&datecolor=%23999999):
    failed to open stream: no suitable wrapper could be found in
    /home/content/s/u/s/sl/html/BMT/index.php on line 139
    Line 139 is the closing tag of the php code.
    Can anyone help?

    quote:
    Originally posted by:
    brywilson88
    Warning: main(): URL file-access is disabled in the server
    configuration in /home/content/s/u/s/sl/html/BMT/index.php on line
    139
    Warning: main(
    http://www.newsfeed.com/tools/steppatch_nc.asp?type=s&t=test&prov=keywords&cat=Business&ca t2=&num_articles=5&show_summaries=Yes&show_sources=No&show_dates=No&title=undefined&keywor ds=B%20Lns&url=&headers_size=12pt&title_size=10pt&title_bold=Yes&font_size=10pt&font_famil y=Arial&text_alignment=Left&space=Yes&titlecolor=%23000000&fcolor=%23000000&desccolor=%230 00000&sourcecolor=%230000FF&datecolor=%23999999):
    failed to open stream: no suitable wrapper could be found in
    /home/content/s/u/s/sl/html/BMT/index.php on line 139
    Directly accessing URL's is forbidden on your server.
    Therefore you cannot pass a URL as an arguement to a function. This
    is a common security setting and you will probably need to use CURL
    to get the data from the external URL and then pass the input to
    main().

  • Almost there, still need email php help!

    Hey there everyone,
    I posted my issue earlier but the thread seems to be dead.  I have been researching php syntax and looked at some other examples online, and I think I almost have it.  I just need a little extra assistance to get there.
    I had my php page partially working earlier, and I was receiving emails from my form submission, but all the data I got was subject and phone number.  I didn't get my thank you page to come up either.  My form has fields for name, email, phone, 3 comment fields and 3 reference fields.  Not sure why I wasn't getting all of the data so I tried redoing my code.
    Now, after redoing the code, I get my thank you page to come up, but I don't get any email notification with the submitted data anymore.  I am not sure why.  I had some code syntax errors but I fixed them through process of elimination and I have no syntax errors now.
    Would someone be able to take a look at my files and tell me what I am doing wrong?  I am always ready to put in work and test through trial and error, but I just am not sure where to start.  I am so close!!!
    Thanks for reading and for any advice, I really appreciate it!
    Jayson

    David, thank you!  It works!  You are my new hero!
    Well, through it all I learned a lot about syntax, headers, form security, etc etc  Very helpful!  Even learned about bare LF's lol.
    I am trying to also have the thank you page redirect to the manufacturer's page after 5 seconds, and I did some reading about redirect code through meta and php.  Not sure if it matters which one I use, and I am also confused about where to put it.
    These are what I found:
    <head>
    <meta http-equiv="refresh" content="5; URL=thankyou.htm">
    </head>
    <?php
    header("refresh: 5; thankyou.htm";
    ?>
    If I use the meta tag, does it go directly in the code on the thank you page?  And if I use the pgp code, where does that go?  I tried it but the page was having trouble redirecting.
    Thanks again for all of your help, and if you feel generous enough to help me with this too I would really appreciate it!
    Jayson

  • Dreamweaver and PHP Help Needed!

    If there is anyone out there who can help, I am working with
    a back-end secured website that is in php and need to manipulate
    and change pageson-the-fly. I'm not sure how to view and actually
    see in Design View my PHP page, as I can best work in Design View.
    Can anyone help out there?
    The website I need help with is
    http://www.businesscreditbuilder.com
    Help needed as soon as possible...
    Thank you...
    If you want to help, I can compensate you for helping with an
    immediate page..

    Thank you for writing. I do need your help, and here's the
    scenario. I work for a company that deals with business credit. In
    the previous post at
    http://www.businesscreditbuilder.com
    there is a login. Once logged in, there is a home page for the
    members. That first page I need to change as soon as possible for
    over 40,000 members. All the members will see the same home page
    inside the members area. You're welcome to login as "makaiman",
    password is "1143mak" to see the first page that comes inside the
    members area I need to change just a little. PHP is installed on a
    remote server running on Windows. I need help or guidance on this
    immediately but I have to sleep right now as it is 1130pm pacific
    and need to have this done by sometime tomorrow morning. I
    appreciate all of your help so very much... any advice would be so
    much appreciated...
    m

  • Cgi/php help?

    Hi, can anyone help - I'm looking to set up an online
    shopping basket on my web site with multiple options for each
    product eg. t-shirt - style logo - personalised with name - shirt
    colour - size etc. I will only be selling six different products in
    total so I don't want anything too over the top.
    Is there a PHP/CGI script or shopping basket program that
    will allow a customer to make their choices by clicking a radio
    button by each option required and then preview the outcome in a
    pop-up window or a new page eg. red t-shirt with fish logo on the
    front and personalised with a name eg. Matthew, before they make
    their purchase?
    Any help appreciated
    Cheers

    Here is a simple bit of PHP to stick in the page your form posts to. You would need to edit the first three variables to your liking, and add the html you want to serve afterwards:
    <pre>
    <?php
    $emailFrom = '[email protected]';
    $emailTo = '[email protected]';
    $emailSubject = 'Subject';
    $date = date('l, \t\h\e dS \o\f F, Y \a\t g:i A');
    $browser = $HTTPSERVER_VARS['HTTP_USERAGENT'];
    $hostname = $HTTPSERVER_VARS['REMOTEADDR'];
    $message = "$date\n\nAddress: $hostname\nBrowser: $browser\n\n";
    foreach ($_POST as $key => $value) {
    $message .= $key . ": " . $value . "\n";
    $mailResult = mail($emailTo,$emailSubject,$message,"From: $emailFrom");
    ?>
    </pre>
    This script will grab the server's date and the submitter's address and browser type. It will then list the name and value of each form field you have put on your form.
    Also, this script expects your form method="post".
    Lastly, you can offer alternate text later on in your html page based on the success of the above script with a snippet like this:
    <pre><?php
    if ($mailResult) {
    echo "Your comments have been received thank you.";
    } else {
    echo "There was an error. Please try again or contact us using an alternate method.";
    ?></pre>

  • URGENT PHP HELP

    I am working on a mail form that is linked to my payroll
    system. It is working great but there has been a request that I add
    a mail to all recipients feature. However I am not to sure how I
    would go about doing this, I am hoping someone can help me atler my
    current code. Right now the recipient selction is a drop down menu
    that is populated from a mySQL table within my payroll system.
    I would like the first option when dropped down to be "All
    Recipents" so when it is sent the mail is sent to everyone's email
    not just the slected individual email.
    Below is the current code I have where only one recipent can
    be selected.
    Thanks in advance!

    Does your e-mail system support Distribution Lists? If so,
    the easiest way
    would be to add the appropriate one to your Dropdown list.
    If not, then the only other way I see to do this is to check
    whether "All
    Recipients" is selected. If it is, loop through all of the
    addresses and
    build up the BCC: string (it's considered a bad practice to
    put huge lists
    in the TO: field). If not, then use your current code.
    HTH
    Steve
    "bcounts" <[email protected]> wrote in
    message
    news:[email protected]...
    >I am working on a mail form that is linked to my payroll
    system. It is
    >working
    > great but there has been a request that I add a mail to
    all recipients
    > feature.
    > However I am not to sure how I would go about doing
    this, I am hoping
    > someone
    > can help me atler my current code. Right now the
    recipient selction is a
    > drop
    > down menu that is populated from a mySQL table within my
    payroll system.
    >
    > I would like the first option when dropped down to be
    "All Recipents" so
    > when
    > it is sent the mail is sent to everyone's email not just
    the slected
    > individual
    > email.
    >
    > Below is the current code I have where only one recipent
    can be selected.
    >
    > Thanks in advance!
    >
    >
    >
    > ******* HTML CODE *********
    > <?
    > include('auth.php');
    > $user_id = $_GET['user_id'];
    > $result = mysql_query("select * from user_info where
    user_id = $user_id");
    > $row = mysql_fetch_array($result);
    > ?>
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN"
    > "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    > <html xmlns="
    http://www.w3.org/1999/xhtml">
    > <head>
    > <meta http-equiv="Content-Type" content="text/html;
    charset=utf-8" />
    > <title>Untitled Document</title>
    > </head>
    > <body>
    > <input type="hidden" name="user_id"
    value="<?=$user_id?>" />
    > <form method="post" action="send_mail.php">
    > <table bgcolor=#ffffcc align=center>
    > <tr><td><font color=red>*</font>
    Name:</td><td><input name="Name"
    > value="<?=$row['fname']?>
    <?=$row['lname']?>" size=25></td></tr>
    > <tr><td><font color=red>*</font>
    Email:</td><td><input name="Email"
    > value="<?=$row['user_email']?>"
    size=25></td></tr>
    > <tr>
    > <td><font color=red>*</font>
    Recipient:</td>
    > <td align="left"><select name="sendto">
    > <option value="">Select Recipient . .
    .</option>
    > <?php $sql = mysql_query("SELECT * FROM user_info
    ORDER BY lname ASC");
    > while
    > ($row1 = mysql_fetch_array($sql)) { ?>
    > <option value="<?php echo $row1['user_email'];
    ?>"><?php echo
    > $row1['fname'];
    > ?> <?php echo $row1['lname']; ?></option>
    > <?php } ?>
    > </select></td></tr>
    > <tr>
    > <td><font color=red>*</font>
    Subject:</td>
    > <td><input size=25
    name="Subject"></td></tr>
    > <tr><td
    colspan=2>Message:</td></tr>
    > <tr><td colspan=2 align=center><textarea
    name="Message" rows=5
    > cols=35></textarea></td></tr>
    > <tr><td colspan=2 align=center><input
    type=submit name="send" value="Send
    > Mail"></td></tr>
    > <tr>
    > <td colspan=2 align=center><small><font
    color=red>*</font> Indicates
    > Required
    > Field</small></td>
    > </tr>
    > </table>
    > </form>
    > </body>
    > </html>
    >
    > ******* PHP CODE *********
    >
    > <?php
    > $to = $_REQUEST['sendto'];
    > $from = $_REQUEST['Email'];
    > $name = $_REQUEST['Name'];
    > $headers = "From: $from";
    > $subject = $_REQUEST['Subject'];
    >
    > $fields = array();
    > $fields{"Message"} = "Message";
    >
    > $body = ""; foreach($fields as $a => $b){ $body .=
    sprintf("%20
    > %s\n\n",$b,$_REQUEST[$a]);}
    >
    > if($from == '') {print "You have not entered an email,
    please go back and
    > try
    > again";}
    > else {
    > if($subject == '') {print "You have not entered a
    subject, please go back
    > and
    > try again";}
    > else {
    > $send = mail($to, $subject, $body, $headers);
    > if($send)
    > {header( "Location: index.php" );}
    > else
    > {print "You did not choose a recipient or the recipent
    you have chosen did
    > not
    > have an email on file.";}
    > }
    > }
    > ?>
    >

  • Some PHP help

    Hi, I'm new to PHP, currently the following sets the end date
    to the start date:
    function afterSetDateValue(ref_field, target_field, date) {
    if (date!="") {
    var startDate=document.forms[0]["start_date"];
    var endDate=document.forms[0]["end_date"];
    if (target_field==startDate &&
    checkDate(getDateValue(endDate))==0 &&
    compareDates(date, getDateValue(endDate))>0) {
    setDateValue(endDate, date);
    ("End Date was earlier than Start Date, it's now set to
    Start Date.");
    How do I make it so that if the start date is changed to a
    date later than the end date, the end date is start date + 1? I'm
    sure its a simple PHP, but like i said i'm learning!
    Thanks

    ferrarikid123 wrote:
    > How do I make it so that if the start date is changed to
    a date later than
    > the end date, the end date is start date + 1? I'm sure
    its a simple PHP, but
    > like i said i'm learning!
    It's not PHP at all. The script you have shown is JavaScript.
    It's also
    incomplete. You might get more help if you describe in more
    detail
    exactly what it is you're trying to do.
    David Powers
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "Foundation PHP 5 for Flash" (friends of ED)
    http://foundationphp.com/

  • Php help plz

    hey, basic what i would like,,
    is a text box, form whatever. that when something is written
    then submitted it will insert this data into page, but i would need
    several boxs, with multi submit, every box has a seperate cell.
    also the current data will be erased.. thankyou
    please help
    danny
    http://www.habboradio1.com

    Then use the php filesystem functions:
    http://www.php.net/manual/en/ref.filesystem.php

  • PHP Help with Forms

    Hey everyone -
    I have a quote form on my website that I'd like to tweak a
    bit. There are
    some fields that have a drop-down box of "Yes" or "No" and
    directly after
    that it says, "If Yes, ..." So, no matter which option is
    chosen, the user
    still sees that even if it doesn't apply to them - which I'm
    OKAY with for
    the time being, but wish to implement it differently.
    If the user selects "Yes" - I'd like the the field that says
    the question I
    *need* to ask the user if they choose "Yes." If they select
    "No," than the
    box is never shown. Sounds simple enough, right? Right ...
    My concern is a). how to show this hide/don't hide
    functionality, and b).
    how to validate (require) the box being "shown" if they
    choose "Yes" and to
    NOT validate (require) if they choose "No."
    I'm going to upload a .html file to my server that has the
    full code for my
    quote.php page in plain text, so someone can help me
    implement this.
    Quote source code:
    http://www.avenuedesigners.com/tests/quote_source.html
    I colored the big chunks of PHP code red, and the form blue
    for ease.
    I've tried something like this:
    <?php
    if ($_POST['havewebsite'] == "Yes") {
    echo ('<p class="labelbold">If yes, What is the Domain
    Name?</p>
    <input name="currentdomain" type="text"
    class="contactfield2 inputstyled"
    id="currentdomain" value="<?php if
    (isset($_POST[\'currentdomain\'])) echo
    htmlentities($_POST[\'currentdomain\']);?>" tabindex="11"
    />');
    ?>
    And run into two problems:
    1. It only shows up when the page is submitted, and I'm
    naturally assuming
    this is because of the $_POST being in there. I need it to
    display
    immediately if they select "Yes."
    2. It physically prints out: <?php if
    (isset($_POST[\'currentdomain\']))
    echo htmlentities($_POST[\'currentdomain\']);?> - as the
    value of the
    textfield instead of leaving it blank/printing the previously
    entered text.
    How can I fix these, guys? Thank you!
    Shane H
    [email protected]
    http://www.avenuedesigners.com
    =============================================
    Proud GAWDS Member
    http://www.gawds.org/showmember.php?memberid=1495
    Delivering accessible websites to all ...
    =============================================

    you can apply a show-hide layer behavior to the YES check box
    (onClick="MM_ShowHideLayers...)
    and have the inverse show;hide behavior applied toi the NO
    checkbox.
    Once you have a Layer on your page and have applied the
    behavior, you change that Layer into a
    regular div by the way, just leave the same id.
    Then, for validating the question only if yes is selected:
    <?php
    if ($_POST['have_a_website'] == 'yes' &&
    empty($_POST['question'])){
    $error = TRUE;
    ?>
    Shane H wrote:
    > Hey everyone -
    >
    > I have a quote form on my website that I'd like to tweak
    a bit. There are
    > some fields that have a drop-down box of "Yes" or "No"
    and directly after
    > that it says, "If Yes, ..." So, no matter which option
    is chosen, the user
    > still sees that even if it doesn't apply to them - which
    I'm OKAY with for
    > the time being, but wish to implement it differently.
    >
    > If the user selects "Yes" - I'd like the the field that
    says the question I
    > *need* to ask the user if they choose "Yes." If they
    select "No," than the
    > box is never shown. Sounds simple enough, right? Right
    >
    > My concern is a). how to show this hide/don't hide
    functionality, and b).
    > how to validate (require) the box being "shown" if they
    choose "Yes" and to
    > NOT validate (require) if they choose "No."
    >
    > I'm going to upload a .html file to my server that has
    the full code for my
    > quote.php page in plain text, so someone can help me
    implement this.
    >
    > Quote source code:
    >
    http://www.avenuedesigners.com/tests/quote_source.html
    >
    > I colored the big chunks of PHP code red, and the form
    blue for ease.
    >
    > I've tried something like this:
    >
    > <?php
    > if ($_POST['havewebsite'] == "Yes") {
    > echo ('<p class="labelbold">If yes, What is the
    Domain Name?</p>
    > <input name="currentdomain" type="text"
    class="contactfield2 inputstyled"
    > id="currentdomain" value="<?php if
    (isset($_POST[\'currentdomain\'])) echo
    > htmlentities($_POST[\'currentdomain\']);?>"
    tabindex="11" />');
    > }
    > ?>
    >
    > And run into two problems:
    >
    > 1. It only shows up when the page is submitted, and I'm
    naturally assuming
    > this is because of the $_POST being in there. I need it
    to display
    > immediately if they select "Yes."
    >
    > 2. It physically prints out: <?php if
    (isset($_POST[\'currentdomain\']))
    > echo htmlentities($_POST[\'currentdomain\']);?> - as
    the value of the
    > textfield instead of leaving it blank/printing the
    previously entered text.
    >
    > How can I fix these, guys? Thank you!
    >
    seb ( [email protected])
    http://webtrans1.com | high-end web
    design
    Downloads: Slide Show, Directory Browser, Mailing List

  • PHP Help with inherited database site

    Hope someone can help with this, although I might be a bit vague. (But will be happy to post any code that might help.)
    Basically I do a few sites for a company, and everything is coming together nicely moving everything to a new reseller hosting account where everything can site. I'm basically doing some redesign and new database work for them.
    But there's one site I'm basically just trying to move over, that already has a database. I've copied the site onto the new hosting, copied the database across and created a new connection file.
    I must admit the code is all a bit more PHPO heavy than what I'm used to working with. so have run into a problem trying to figure out what data is not displaying due to queries failing. As far as I can tell the connection is working, and the queries have not changed.
    Anyway - the main page is here, where you should be able to click on the furniture images to go to the product page :
    http://www.miradatravelmedia.com/lusty/public_html/index.php
    But when you click through the product page query is failing :
    http://www.miradatravelmedia.com/lusty/public_html/products.php?category=1
    The products page is mostly PHP and looks like this :
    [PHP]<?php
    if (!@empty($_REQUEST["img"])) {
      require_once("../includes/hft_image.php");
      $img = new hft_image($_REQUEST["img"]);
      $img->resize(200,180,"-");
      $img->output_resized("");
      exit;
    $page = "products";
    include("../includes/header.php");
    include("../includes/db_open.php");
    $sql = "SELECT `id`, `name` FROM `categories` WHERE `id` = '" . $_REQUEST["category"] . "'";
    $result = mysql_query($sql) or die("Query failed : $sql at line " . __line__);
    $category = mysql_fetch_assoc($result);
    ?>
    <div id="trail"><a href="shop.php">Shop</a> &gt; Lloyd Loom <?php echo $category["name"]?></div>
      <div class="clear" id="divider1"><img src="images/spacer.gif" alt="<?php echo keyword()?>" /></div>
    <h1>Lloyd Loom <?php echo $category["name"]?></h1>
    <?php
    $sql =
      "SELECT * " .
      "FROM `products` " .
      "WHERE `category` = '" . $_REQUEST["category"] . "' " .
      "ORDER BY `order`";
    $result = mysql_query($sql) or die("Query failed : $sql at line " . __line__);
    if (mysql_num_rows($result) == 0) {
    ?>
    <p>Coming soon ...</p>
    <?php
    } else {
      $n = 0;
      while ($row = mysql_fetch_assoc($result)) {
        $n++;
    ?>
    <a href="product.php?id=<?php echo $row["id"]?>" class="product"<?php if ($n == mysql_num_rows($result)) echo " id=\"last\""?>>
    <?php
        if ($file = glob("images/products/" . $row["id"] . "_*.*")) {
    ?>
    <img src="img.php?img=<?php echo $file[0]?>&width=200&height=180" alt="<?php echo $row["code"]?>" />
    <?php
        } else {
    ?>
    <div id="no_image">No image found</div>
    <?php
    ?>
    <?php echo $row["code"]?>
    </a>
    <?php
        if (is_int($n / 4)) {
    ?>
    <div class="clear"><img src="images/spacer.gif" alt="<?php echo keyword()?>" /></div>
    <?php
    ?>
      <div class="clear" id="divider2"><img src="images/spacer.gif" alt="<?php echo keyword()?>" /></div>
    <?php
    include("../includes/footer.php");
    ?>[/PHP]
    If anyone could shed any light on what's going wrong still, that would be much appreciated.
    Thanks.

    Iain71 wrote:
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''categories' WHERE 'id' = '1'' at line 1
    So it does look a bit odd with the quotes.
    Column names in a SQL query must not be in quotes. The MySQL error message tells you that the SQL syntax error is "near" the section it refers to. In other words, the error is just before that part of the query. Normally, you need to display the whole query to spot the error, but it's obvious in this particular case, because there's a quotation mark after categories, indicating that you've put the column name in quotes. Anyway, you've solved that problem by using the version I suggested.
    I still haven't managed to establish where this vat.php file is - is there any explanation for it not being visible on the original hosting server where the site is working? And could it have anything to do with the query not working?
    No, it has nothing to do with the query not working, and the reason you can't see it on the live site is because there's no error. The error message on your test site tells you exactly where to look for the problem. The file vat.php is included by header.php on line 19. Either vat.php isn't on your server, or the code on line 19 of header.php is pointing to the wrong location.

Maybe you are looking for

  • How to add jQuery to master page

    Hi, I'm using designer to add jQuery to master page. But i get this error below. Please help me to understand this and solve this. Many thanks for your response in advance.

  • Custom tag with struts

    Hi I would like to create a custom tag that will print this section of html with struts:<tr>      <td class="f_name"><bean:message bundle="fields" key="firstName" /></td>      <td class="f_value"><html:text property="firstName" /></td> </tr>This mean

  • Group currency amount missing with transaction code FBB1

    Hi, Whenever there is a document posted using transaction code FBB1 there is no updation of amount in group currency. If the document currency is matching with local currency then even the local currency is also with zero value. Can somebody explain

  • Can't install on DMraid

    I am having trouble installing on dmraid because I can't quite mount the device. I think I could if I could build my own install disk, by modifying the last available one. What I need to know in order to do so is some information on how the current I

  • Startup disk setting ignored if starting from off iMac

    In order to speed up the performance of my system (2008 iMac 2.8 Core 2 Duo - 24 inches running Yosemite (10.10.2), I have tried to start running my system off of a spare SSD in a Firewire 800 Enclosure.  Works fine when I start the computer off of a