nigelburrell

[QUOTE=pranayshedge;1046288]Which all programming languages do I need to learn to become a webmaster?[/QUOTE]

There's a lot of different web languages to consider, and depends on what type of development you're interested in pursueing... I don't think there's some "definitive list" as such that applies to every person, so I would recommend that you conduct some personal research to firstly identify your interests and requirements. I would start with learning HTML first and how to use CSS (style sheets), accompanied with a server-side language such as PHP or ASP, then I would learn how to use the server-side language with a database like SQL Server or MySQL. You can build any site based a combination of those languages. Alternatively, instead of literally coding every page, you could install a CMS (Content Management Site) where the entire site is maintained and managed via modules, plug-ins, and components that you can install and configure relatively easily.

I hope this helps somewhat.

nigelburrell

Thanks Airshow.... your comments are very useful. I agree, transitional effects are not necessarily a bad thing on some occasions (it kind of looks cool sometimes) but for me I'm using a centering div for populating lots of small menu icons with text descriptions so it doesn't make sense to have them 'jumping' around the screen to position themselves during page loads, which is even more obvious on slower PCs and/or slow internet connections.

nigelburrell

Thanks again Troy III, I really appreciate your thoughts regarding inline divs etc. You've given me much to ponder about with the rest of my website design. Have a good day.

nigelburrell

Thanks Airshow for your post and solution.

I tried your code and it works to a certain extend, but instead of centering the content perfectly, it appears with a slight right offset beyond 50% across the page, but that's minor as I only had to adjust the 100% width in DIV1 to 80% instead. And another thing is that each DIV2 block re-positions itself as the page loads which looks a little strange and rather cumbersome, especially if I have a large numer of DIV2s appearing on the page.

In the end, I went with Troy III's solution simply because the DIV2 content appears instantly (without re-positioning during page loads), but I am curious about your comment that you know of some issues with inline divs...? Is this a cross-browser thing?

Thanks again for your code, I really appreciate your help.

nigelburrell

Thanks Troy III... your solution works well!!

It's funny, but it's seems a bit strange to me why DIVs are so problematic in these situations. In moments like this I'm tempted to resort back to HTML tables, and that's saying something... the very thing DIVs are meant to replace.

But thanks for replying and providing a solution... I've tried it in my code, and it does the job perfectly!

By the way, are you aware of any issues with inline divs that Airshow refers to in his post?

nigelburrell Light Poster

I'm trying to use DIVs contained within a DIV to show content which is centered horizontally on the page, as per this example.

+=========== DIV 1 ===========+
+------+=====+=====+=====+-------+
+------+ DIV 2 + DIV 2 + DIV 2 +--------+
+------+=====+=====+=====+-------+
+==========================+

Here's the CSS and HTML code I'm using:

CSS
[CODE]
.DIV1 {
width: 100%;
margin-left: auto;
margin-right: auto;
height: 70px;
}

.DIV2 {
float: left;
text-align: center;
width: 80px;
}
[/CODE]

HTML
[CODE]

Content 1 Content 2 Content 3

[/CODE]

I've learnt that by setting margin-left and margin-right to 'auto' in DIV1 the content inside is centered, but only if it contains one DIV2 inside it.

When I add more DIV2s then the content inside DIV1 now shows on the left and ignores any centering...

+=========== DIV 1 ===========+
+=====+=====+=====+---------------+

  • DIV 2 + DIV 2 + DIV 2 +----------------+
    +=====+=====+=====+---------------+
    +==========================+

Does anyone please know why this is happening, and how I can fix it?

Thanks

nigelburrell

[QUOTE=PsychicTide;914960]As far as I know one of these will show the system time instead of server... [url]http://www.sivamdesign.com/scripts/clocks.html[/url][/QUOTE]

Perfect... thanks for that!!

nigelburrell

[QUOTE=emarshah;915023]Hello nigelburrell,

[INDENT]A simple solution to your problem can be to first save the timezone(can be called as offset) as a signed number (e.g., +5 or -5 etc) of each user in the database. And when he signed it at a particular time, do calculate his local time by adding this Offset to the UTC.I hope this will be helpful....
[/INDENT][/QUOTE]

Yes, I've seen the offset function, might do what you suggested as I think it's the best way. Thanks for your suggestion.

nigelburrell

[QUOTE=sureronald;914720]What you would need here is some knowledge in ajax and javascript . When a user logs in for example build the time on his local machine using javascript and pass it to the server using Ajax.
You can then save it to the database with the receiving script. For timezones I am not aware but I remember stumbling on something like a timezone method in the javascript Date object.
Hope it helps![/QUOTE]

Ok thanks, will look into this timezone method via the javascript Date object a bit more.

nigelburrell Light Poster

I am building a website for users that exist around the world and need to show the user's "local machine" time and timezone, not the time of the website host server.

Is there a javascript function or process to determine this?

nigelburrell Light Poster

I am building a project management website which enables users from around the world to login and automatically register their time against various work projects. I need to save their login time to the database using their "local machine" time (the time as it exists for them, not the time of the website host server), and also their timezone information - so that I can determine where and what time in the world each user is logging in from.

I am already familiar with writing PHP code to save records to the database, but what I need to know is... is there a timezone/datetime function or process in PHP to determine the user's local time and timezone?

nigelburrell

[QUOTE=kireol;912946][code=php]
$result = mysql_query("UPDATE table SET name='joe' WHERE age='21'")
or die(mysql_error());
[/code]

For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc, mysql_query() returns TRUE on success or FALSE on error.

[url]http://us.php.net/mysql_query[/url][/QUOTE]

Ok, great. Thanks.

nigelburrell Light Poster

In my webpage I'm using the PHP function mysql_fetch_array to check if records are successfully retrieved from the database. If records are returned then I can assign variables with the database fields...

[code=php]
$checkdb = mysql_query("SELECT * FROM products");
if ($info = mysql_fetch_array( $checkdb )) {
$productName = $info['ProductName'];
}
[/code]

But how do I check when I change the SQL to an UPDATE or INSERT query if it has worked successfully? I obviously don't want to use the same method as there's no requirement to assign variables from the record fields (as in the example above), but still want to validate if the database UPDATE or INSERT worked correctly. How do I do this?

nigelburrell

[QUOTE=FlashCreations;907071]Correct, unless these bots can register on your sites and access the page with your email. You can always protect your email simply by making it an image and putting that image on your page instead of using a plugin like this.[/QUOTE]

That's true, good idea. I might pursue this option and see if it works well. Thanks for your response.

nigelburrell

What a great idea to put two textboxes alongside each other with the "@" character in the middle. I will code this and see how it works.

Actually, I had to smile when I read your comment about the auditmypc website generating fake email addresses to poison spambots... what a great idea to fight back against spam!!

nigelburrell

[QUOTE=almostbob;906644]that address is sent in clear text through however many relays, proxies, exist in the traceroute between your host and the user,
any one of them could be compromised
with an appropriate packet sniffer no plain text is safe
how likely do you enticipate interception
you could use something like
break the address at the @ sign, send two parts to
2 text boxes
1 for user name
1 for domain
and not sent the @ sign at all, and reconstruct the address in php/asp before submitting to the database,[/QUOTE]

Interesting solution, I might think about doing that. Thanks for the idea.

nigelburrell Light Poster

Hi,

I'm using a joomla cms to build a website, and have discovered that joomla uses a built-in plug-in called Email Cloacking which obfuscates email addresses prior to showing them on the webpage. They simply appear as "mailto" links which makes it harder for scrapers and bots to pick up.

However, I am developing a website that requires user-login access to pages where user's email addresses need to be shown (and edited) as plain text inside text boxes. I've had to disable this joomla plug-in so that email addresses do not contain the additional javascript and scrambled information for spam protection.

My question is, even though I've disabled an important spam protection function, I'm assuming it doesn't matter given that the email addresses will appear only in webpages requiring user-login access. Obviously, if the email addresses were published in public access pages, then yes... it's a risk, but surely scrapers and bots can't access pages protected behind user logins - as they would need to simulate a user login to access such information, right?

nigelburrell

[QUOTE=almostbob;906435]This is Joomla's spam protection
Joomla has a plugin that obfuscates email addresses, to make it harder for scrapers and bots.
The visible address and effective address are not changed, just what robots can see.
you can probably disable the plugin somewhere in Joomla configuration.
There is likely a 'howto' on setting up the editbox without disabling spam protection, somewhere on the web. Joomla is a popular cms

Sometimes the help, is worse than the problem[/QUOTE]

Exactly. I discovered that Joomla has a plug-in called Email Cloacking which obfuscates email addresses prior to showing them on the webpage. I simply disabled this plug-in and now all email addresses appear as plain text.

Can I ask your opinion though... even though I'm disabling an important spam protection function, I'm assuming it doesn't matter given that email addresses are only appearing in text boxes in user-login access webpages (not publicly-accessable pages). Does that matter? Obviously, if the email addresses were published on public access pages, then yes... it's a risk, but what if they were only shown in text boxes on registered pages requiring user-login access? Surely scrapers and bots can't access such pages given that they are protected behind user logins - they would need to simulate a user login to access such information, right? Or is it best to keep the obfuscation protection enabled, and find another method to populate the text boxes with the plain text version?

Actually, I hope you don't mind but I'm going to start a ...

nigelburrell

[QUOTE=pritaeas;906365]Since you mention Joomla, it is possible that this is Joomla's way of storing e-mail addresses. You could use a regular expression to strip all unnecessary code, but there could be a lot of exceptions. Maybe Joomla has a function to retrieve it built-in.[/QUOTE]

Thanks your response. I found where in Joomla this is occuring. The email addresses are stored as plain text in the database, but Joomla uses a plug-in called Email Cloacking which obfuscates email addresses prior to showing them on the webpage. I simply disabled this plug-in and now all email addresses appear as plain text.

nigelburrell

[QUOTE=almostbob;905318]the cms appears to have a function built in to obfuscate email addresses, this obfuscation is the javascript shown.
check the settings in the cms for obfuscation and change it from auto to manual, (maybe).
or try emailaddress&[B][/b]#[b][/B]64;domain.com[/QUOTE]

Ok, I found it... in the cms there's an email cloacking plug-in. All I needed to do was disable it. Thanks for pointing me in the right direction, and thanks to everyone for their suggestions and help.

nigelburrell

[QUOTE=almostbob;905318]the cms appears to have a function built in to obfuscate email addresses, this obfuscation is the javascript shown.
check the settings in the cms for obfuscation and change it from auto to manual, (maybe).
or try emailaddress&[B][/b]#[b][/B]64;domain.com[/QUOTE]

Exactly!! Thanks for your suggestion. I'm using Joomla cms and I did some research after reading your post and have just discovered that it does indeed use an inbuilt javascript obfuscation, however, I cannot find any setting in the cms for turning it off or on (auto to manual). I'm certain this is the "culprit".

No doubt the obfuscation function is there for good valid reasons, i.e. protection against spam, but I'm only wanting to show the email addresses in user-access webpages, not publicly accessable pages.

I tried the emailaddress@domain.com but still appears as an email link on the webpage.

Does anyone know where this setting could be in joomla?

nigelburrell

[QUOTE=heroic;905288]change

document.write( '<a ' + path + '\'' + prefix + ':' + addy27400 + '\'>' ); document.write( addy27400 ); document.write( '<\/a>' );

to
document.write( addy27400);

that should do it![/QUOTE]

Thanks for the code change suggestion, however, I don't code this javascript into my webpage in the first place... that's the problem. I don't know where this javascript script comes from, and I don't want it to be there. I simply code echo "myemail@whatever.com" into my PHP page and then when it outputs to the screen the email address has automatically been converted from plain text to a "mailto" (active) link. I want it to appear simply as plain text.

nigelburrell

[QUOTE=adatapost;905271]Which editor are you using?[/QUOTE]

I'm developing a joomla CMS website, so the editor is an inbuilt editor. I don't think the problem is with the editor itself as all PHP code is saved as is. I simply code echo "myemail@whatever.com" and the resulting webpage shows the text as a "mailto" (active) link. All I want is for the email address to show as plain text.

The conversion appears to occur between the PHP code being sent to the server for processing, and the page output itself. But I have no idea where this javascript code comes from.

nigelburrell Light Poster

Whenever I echo or print a string containing an email address to my webpage the HTML code automatically parses the text and shows it as a "mailto" link.

If I use... echo "Hello";

it prints Hello as expected on the webpage.

If I use... echo "hello@whatever.com";

it now appears as a mailto link, and if I look at the HTML code source the email address now contains all of this additional javascript...

[code=JavaScript] \n This e-mail address is being protected from spambots. You need JavaScript enabled to view it [/code]

My question is, how can I show email addresses on my webpage in plain text (i.e. not as an email link)?

nigelburrell Light Poster

Hi,

I'm not entirely sure which forum to post this question because I cannot determine whether it's a MySQL, Joomla, or PHP issue. But I will post it here, as some of you may know about this.

I am using a custom built "user" table in my MySQL database, and the email addresses are being stored in plain text as VARCHAR(60). However, when I retrieve an email address from a record, and then display it on my webpage, it appears as an "email link" and not as plain text.

This is the code I'm using to retrieve the email address from the MySQL database.

[code=php]$check = mysql_query("SELECT * FROM users WHERE ID = '$userID'");
if ($info = mysql_fetch_array( $check ))
{
// Get db fields
$email = $info['email'];
}

echo $email;[/code]

The PHP code works fine, but the email address variable now contains the following javascript information only after it's been retrieved from the database...

[code=JavaScript] \n This e-mail address is being protected from spambots. You need JavaScript enabled to view it <!-- document.write( '</' ); document.write( ...

nigelburrell

[QUOTE=ardav;892203]I thought the hidden input couldn't accept anything coz it's hidden?

Try this for a simple button style:

[url]http://www.dynamicdrive.com/style/csslibrary/item/stylish-submit-buttons/[/url]

There are loads of other examples - just google 'submit button css'[/QUOTE]

The input button is hidden because apparently it's still needed (triggered) upon form submit.

Thanks for the helpful link.

nigelburrell

[QUOTE=ardav;891993]For automatic submission on enter, I thought you needed a submit button. Perhaps I'm wrong? You seem to have a link. Is this so you can style it with CSS? You can style buttons with CSS too.

The link isn't to ajax, so why are you using a link instead of a button?[/QUOTE]

Well in this case the hidden button is the submit button which is triggered by the link...

[CODE]

[/CODE]

And yes, I'm using a link to style with CSS. I didn't know I could style buttons with CSS as well...!?!

nigelburrell

[QUOTE=nikesh.yadav;891489][CODE]

[/CODE]

make the changes as you wish but its work when user hit the enter key after filling the field.

but you want to put submit button u also put that with in the form tag.

:)[/QUOTE]

Ok, it's very strange but now I'm finding that sometimes it works, and sometimes it doesn't, about a 50% success rate!! This is either when I hit Enter (in the password field) or clicking the Submit button the form (I call the same form by the way with code to process the POST vars...

[CODE]
if (isset($_POST['form_submitted'])) { // if form has been submitted
[/CODE]

Here's a sample of my form code...

[CODE]

Login Keep me logged in on this computer (learn more)

[/CODE]

Any ideas what's going wrong? Sometimes it works and processes the form, sometimes it doesn't and just reloads the page without doing anything.

nigelburrell

[QUOTE=Josh Connerty;889610]No you don't...

At least I don't...

Should do it fine, I presume nigelburrell (if he is still alive) has made a little cock up in his form, the idea is that it submits the current form...[/QUOTE]

What I found is that if the form contains only one textbox, then hitting Enter worked. But the moment I included two or more textboxes, in this case, a username and password textbox, then I needed the OnKey trigger code on the password textbox. I call the javascript from this to submit the current form and it works well now.

Thanks for your help.

nigelburrell

[QUOTE=Tulsa;888574]hi
i think you want that login form submit that user press enter key after entering password right.
so i pu one example here where i call javascript function on keypress of textbox
[code]

[/code]
[code]

function entersubmit(field,e) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; if (keycode == 13) { //alert('hi'); if(Email.validate() && Passwd.validate()) { field.form.action="userlogin"; field.form.submit(); return false; } } else return true; }

[/code]

Thanks[/QUOTE]

Thanks for your code Tulsa, it works great.