#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0

    Emails and Web templates using XML


    am a self confessed newbie to web sites and programing.. So when asked to put a website together, it was a challenge I was willing to take on.. BUT when it turned out to be around flash and XML.. Nightmare !!!

    the website is a template - xml-creative-portfolio-deeplinking-template and this has a file 'contact.xml. that has 0 bytes (nothing on page) and the settings.xml and email.php script give no clue as to how to set up the contact form located on 'Contact' page.

    Nothing about the form on this template works other than you can see it !!!

    Does 'anybody' have a clue as to what I need to do to get this working?

    Maybe give a total newbie clear instruction that my kid sister could follow?
  2. #2
  3. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,757
    Rep Power
    9397
    Not a clue. We'd really have to know how the site works, what the Flash app does, the schema for the XML files... to be able to give any specific advice.

    Someone's telling you to put the site together so they must know something about it. Ask them.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0

    @ requinix


    Thanks for the prompt reply - You made some obvious and very relevant points !!

    Of course you have no clue. I have given little to help

    As I say.. Contact.xml is an empty page.. So reads nothing (very odd)

    The site's settings.xml has the following for e-mail -
    Code:
    	<servicesItemBackgroundWidth>800</servicesItemBackgroundWidth>
    	<servicesItemBackgroundHeight>160</servicesItemBackgroundHeight>
    	<servicesItemBackgroundColor>0x000000</servicesItemBackgroundColor>
    	<servicesItemBackgroundAlpha>0.5</servicesItemBackgroundAlpha>
    	<servicesItemBackgroundBlur>30</servicesItemBackgroundBlur>
    	<distanceBetweenServicesItems>20</distanceBetweenServicesItems>
    	<servicesArrowMargin>20</servicesArrowMargin>
    	<servicesArrowBackgroundWidth>40</servicesArrowBackgroundWidth>
    	<servicesArrowBackgroundHeight>40</servicesArrowBackgroundHeight>
    	<servicesArrowBackgroundColor>0x000000</servicesArrowBackgroundColor>
    	<servicesArrowBackgroundAlpha>0.5</servicesArrowBackgroundAlpha>
    	<servicesArrowColor>0xffffff</servicesArrowColor>
    	<servicesArrowAlpha>0.5</servicesArrowAlpha>
    	<servicesArrowOverAlpha>1</servicesArrowOverAlpha>
    	<servicesArrowThickness>2</servicesArrowThickness>
    	<servicesArrowWidth>20</servicesArrowWidth>
    	<servicesArrowHeight>10</servicesArrowHeight>
    	
    	<contactBackgroundWidth>800</contactBackgroundWidth>
    	<contactBackgroundHeight>360</contactBackgroundHeight>
    	<contactBackgroundColor>0x000000</contactBackgroundColor>
    	<contactBackgroundAlpha>0.5</contactBackgroundAlpha>
    	<contactBackgroundBlur>30</contactBackgroundBlur>
    	<contactTextMarginLeft>30</contactTextMarginLeft>
    	<contactTextMarginTop>30</contactTextMarginTop>
    	<contactTextWidth>320</contactTextWidth>
    	<contactTextHeight>400</contactTextHeight>
    	<feedbackFormMarginRight>50</feedbackFormMarginRight>
    	<feedbackFormMarginTop>40</feedbackFormMarginTop>
    	<feedbackFormColor>0x000000</feedbackFormColor>
    	<feedbackFormBorderThickness>1</feedbackFormBorderThickness>
    	<feedbackFormBorderColor>0xffffff</feedbackFormBorderColor>
    	<feedbackFormBorderAlpha>0.3</feedbackFormBorderAlpha>
    	<feedbackFormWidth>350</feedbackFormWidth>
    	<feedbackFormSmallHeight>25</feedbackFormSmallHeight>
    	<feedbackFormBigHeight>200</feedbackFormBigHeight>
    	<feedbackFormNameText>NAME:</feedbackFormNameText>
    	<feedbackFormEmailText>EMAIL:</feedbackFormEmailText>
    	<feedbackFormMessageText>MESSAGE:</feedbackFormMessageText>
    	<feedbackFormTextColor>0xffffff</feedbackFormTextColor>
    	<sendButtonText>SEND</sendButtonText>
    	<sendButtonColor>0xcccccc</sendButtonColor>
    	<sendButtonOverColor>0x9898cb</sendButtonOverColor>
    	<sendButtonSize>17</sendButtonSize>
    	<thankYouText>Thank you, your message has been sent.</thankYouText>
    	<thankYouTextColor>0xffffff</thankYouTextColor>
    	<thankYouTextSize>15</thankYouTextSize>
    The Email.php is within it's own folder /PHP and this reads -
    Code:
    <?php
    
    if(empty($_POST['senderEmail'])) {	echo"Error: No email address found";
    	
    	exit;
    
    }
    
    $senderName		= $_POST['senderName'];
    
    $senderEmail	= $_POST['senderEmail'];
    
    $senderMessage	= nl2br($_POST['senderMessage']);
    
    $companyEmail = $_POST['companyEmail'];
    
    $siteName		= $_POST['siteName'];
    
    $headers  = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    
    $headers .= "From: $siteName <> \n";
    $headers .= "Reply-To: " . $senderEmail . "\n\n";
    
    
    $to 			= "$companyEmail";
    
    $emailBody 		= "From: $senderName <br />
    				Email: $senderEmail <br /> <br />
    				Message: <br />
    			  	$senderMessage
    			  	<br />";  
    
    $message 		= $emailBody;
    $ok = mail($to, $message, $headers);
    
    ?>
    If it helps the whole site/code is located here -

    http://www.ihost4u.co.uk/code.zip

    When the site is active, it will bee soon clear that the direct email link on Contact page works, since this is using local email calls. On the same page, the form look pretty. BUT does not have any links to any external mail service I can see. So is clearly tested as not working !!

    Hope this helps...

    As for asking the owner of would be site ??

    She has less a clue than I do !!
  6. #4
  7. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,696
    Rep Power
    6351
    Paste your code into the big text area, highlight it, THEN click the code button. All your code is one line and we can't read it.

    Who designed this site in the first place? Why is it the blind leading the blind? Where's the person who knows the answers?
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0
    I have redone script posting in original message rather than duplicate..

    As for blind leading the blind? Everybody needs to start an education at some point. My friend apparently wanted a site to give her home run business a professional look to it. And having taken my suggestion of 'go look' and find something I might work with, came back as... Well.. As you see... !!

    HTML I understand.. PHP to a point.. I understand. Photoshop and Micky mouse level web sites I can do eyes closed. XML ??? Is why I am here !!!
  10. #6
  11. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,757
    Rep Power
    9397
    He meant that you (who doesn't know how the system works) are leading us (who also don't know how the system works). It's seemingly some custom site which means we know nothing about it, and if you know nothing about it either then we're kinda at an impasse.

    The email script isn't very secure but so far that's the only thing we can help with. Seeing the XML helps but it's hard to tell what it does without seeing the code (Flash, I assume) that uses it.

    Also, what's the question? The contact form isn't working? How so?
  12. #7
  13. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,696
    Rep Power
    6351
    He meant that you (who doesn't know how the system works) are leading us (who also don't know how the system works).
    Also the site owner/operator doesn't know how it works. There's 5 people involved, none of them know how this is supposed to work.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    4
    Rep Power
    0
    In my defense guys. I did place a url with a download. Its the whole site as given to me. It should provide 'context'.

    What I have with regards .as is this -

    [/CODE]package components.sections.contact
    {
    import com.creativearmenia.tween.Tweenik;
    import com.creativearmenia.tween.easing.Expo;
    import com.creativearmenia.util.Base64;

    import data.SiteData;

    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.net.URLVariables;
    import flash.text.AntiAliasType;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.text.TextFormat;
    import flash.utils.setTimeout;


    public class FeedbackForm extends Sprite
    {
    //private variables
    private var _input1:InputArea;
    private var _input2:InputArea;
    private var _input3:InputArea;

    private var _sendButton:SendButton;

    private var _text:TextField;
    private var _textFormat:TextFormat;

    private var _email:String;

    public function FeedbackForm(mail:String)
    {
    _email = mail;

    //create Name Form
    _input1 = new InputArea(SiteData.settings.feedbackFormWidth, SiteData.settings.feedbackFormSmallHeight, false, String(SiteData.settings.feedbackFormNameText), "not mail");
    _input1.x = 0;
    _input1.y = 0;
    addChild(_input1);

    //create Email Form
    _input2 = new InputArea(SiteData.settings.feedbackFormWidth, SiteData.settings.feedbackFormSmallHeight, false, String(SiteData.settings.feedbackFormEmailText), "mail");
    _input2.x = 0;
    _input2.y = uint(SiteData.settings.feedbackFormSmallHeight) + 5;
    addChild(_input2);

    //create Message Form
    _input3 = new InputArea(SiteData.settings.feedbackFormWidth, SiteData.settings.feedbackFormBigHeight, true, String(SiteData.settings.feedbackFormMessageText), "not mail");
    _input3.x = 0;
    _input3.y = 2 * uint(SiteData.settings.feedbackFormSmallHeight) + 10;
    addChild(_input3);

    //create Send Button
    _sendButton = new SendButton();
    _sendButton.x = SiteData.settings.feedbackFormWidth - _sendButton.width;
    _sendButton.y = _input3.y + uint(SiteData.settings.feedbackFormBigHeight) + 10;
    _sendButton.addEventListener(MouseEvent.CLICK, sendClick);
    addChild(_sendButton);



    _textFormat = new TextFormat();
    _textFormat.color = SiteData.settings.thankYouTextColor;
    _textFormat.size = SiteData.settings.thankYouTextSize;
    _textFormat.font = main._siteFontName;

    //create Thank You Text
    _text = new TextField();
    _text.defaultTextFormat = _textFormat;
    _text.text = SiteData.settings.thankYouText;
    _text.selectable = false;
    _text.embedFonts = true;
    _text.antiAliasType = AntiAliasType.ADVANCED;
    _text.width = uint(SiteData.settings.feedbackFormWidth) - 50;
    _text.height = SiteData.settings.thankYouTextSize + 6;
    _text.x = 0;
    _text.y = _sendButton.y;
    _text.alpha = 0;

    addChild(_text);
    }


    private function sendClick(event:MouseEvent):void
    {
    if (_input1.getCheck() == true && _input2.getCheck() == true && _input3.getCheck() == true)
    {
    _sendButton.removeEventListener(MouseEvent.CLICK, sendClick);
    _sendButton.disable();

    var url:URLLoader = new URLLoader();
    var req:URLRequest = new URLRequest("php/email.php");
    var urlvar:URLVariables = new URLVariables();
    urlvar["sendto"] = Base64.encode(_email);
    urlvar["name"] = Base64.encode(_input1.getText());
    urlvar["email"] = Base64.encode(_input2.getText());
    urlvar["question"] = Base64.encode(_input3.getText());
    req.data = urlvar;

    url.addEventListener(Event.COMPLETE, complete);
    url.load(req);
    }
    }

    private function complete(event:Event):void
    {
    _input1.clear_();
    _input2.clear_();
    _input3.clear_();
    _sendButton.enable();
    _sendButton.addEventListener(MouseEvent.CLICK, sendClick);

    Tweenik.to(_text, .7, {alpha:1}, {ease:Expo.easeOut, onComplete:hideAgain});
    }

    private function hideAgain(e:Event):void
    {
    setTimeout(fadeOut, 3000);
    }

    private function fadeOut():void
    {
    Tweenik.to(_text, .7, {alpha:0}, {ease:Expo.easeOut});
    }
    }
    }[/CODE]

    And it (I think) suggests a link between what ever is given in .xml somehow gets passed (??) into .php. (like I would know this !!) This code came from my 'tearing' a .swf file apart with some tool in an attempt to figure out what's what.. Or at least 'try' to sort out my problem alone..

    And given to date nobody has been able to answer my seemingly basic question; I guess I need to try another web site. Or just give up on finding anybody who knows enough to 'actually' advise..

IMN logo majestic logo threadwatch logo seochat tools logo