Jump to content

noob with html question


Recommended Posts

I've searched the forums and can't find an answer and I think I've been staring at it too long now.

This is what I have and I understand about the semicolon in line 11 but I can't wrap my ahead around how I need to go about wrapping that line properly with single quotes or double quotes to get around the semicolon acting like the comment character.

$oIE = _IECreate ("http://somewebsite")
$oForm = _IEFormGetObjByName ($oIE, "f")
$oQuery = _IEFormElementGetObjByName ($oForm, "title")
$oQuery2 = _IEFormElementGetObjByName ($oForm, "email")
$oQuery3 = _IEFormElementGetObjByName ($oForm, "addy")
_IEFormElementSetValue ($oQuery, "returning?")
_IEFormElementSetValue ($oQuery2, "xxxx@xxxxx.com")
$sHTML = "" & @CR
$sHTML &= "<html><head>" & @CR
$sHTML &= "<title>Somthing!</title>" & @CR
$sHTML &= "<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>" & @CR
$sHTML &= "<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">" & @CR
$sHTML &= "<table width="10%" height="10%" border="0" align="left" cellpadding="0" cellspacing="0">" & @CR
$sHTML &= "<tr><td><div align="'left'">" & @CR
$sHTML &= "<table id="'Table_01'" width="'550'" height="'350'" border="'0'" cellpadding="'0'" cellspacing="'0'">" & @CR
$sHTML &= "<tr><td><a href="http://www.myothersite.com">" & @CR
$sHTML &= "<img src="http://www.myothersite.com/img" width="550" height="88" border="0"></a></td></tr>" & @CR
$sHTML &= "</table>" & @CR
$sHTML &= "</div></td></tr></table>" & @CR
$sHTML &= "</body></html>" & @CR)
_IEDocWriteHTML($oQuery3,$sHTML)
_IEAction($oQuery3,"refresh")

I've tried several iterations of using the quotes but still end up with various errors:"unterminated string","missing separator" etc..

Considering yesterday I started this project with just using a bunch of basic commands to copy and paste and mousemouse to today jumping into _IE functions I'm making progress, just hitting a speed bump.

Thanks for all the invaluable information on here and thanks in advance for any help.

Link to comment
Share on other sites

Start and end the string with a single quote ( ' ) and that way the double quotes inside the string won't throw off your script.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Thanks BrewMan

Thanks JohnQSmith ( I discovered that and started cleaning it up)

Im all the way to the bottom and just getting an "Unbalanced brackets in expression" here

$sHTML &= "</body></html>" & @CR)

Im sure that's about the closing tags in the html (which I'm no expert, I'm more SQL/VBA).

Thanks again for both of your quick responses.

For future reference for any one else, you'll need to also take away the quotes around your aligns and bgcolor

Edited by mrbungle25
Link to comment
Share on other sites

Your "unbalanced brackets" issue is because you have a parentheses at the end of the line that doesn't belong there.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

I'm glad it's working for you now. Glad I could help with it.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...