Jump to content

MrAdam

Members
  • Posts

    489
  • Joined

  • Last visited

Posts posted by MrAdam

  1. it will try opening them with the same name, i think that's why it wouldn't work. try something like:

    function openWins() {var toOpen = 5;var i = 0;while (i < toOpen) {	 window.open('myFile.html', i);	 i++;}}

  2. yes i know it's completely unsafe i dont use it to store valueable information.But what if u put it in a external script::?
    people could still right click, see .. src="file.js" .. open the script and find the password. - glad the link came in useful btw
  3. [quote name='The master' post='53392' date='Jan 1 2007, 06:59 PM']No with javascript u can't make a page that is only viewable by that member, for that section u should be with PHP.I dont know that language.But u can make a prompt box that brings the user to another pagewith a sort of passwordlike [html]<script type="text/javascript">function pass(){var pass= prompt ("pls enter the password","***")var mypass = "hello"if (pass==mypass){document.location="http://www.....")}</script>[/quote]users viewing the page could easily find the password by viewing the source - completely unsafe.and yes.. you will need to learn PHP/MySQL .. [u][color="#800080"][url="http://www.php-mysql-tutorial.com/"]http://www.php-mysql-tutorial.com/[/url][/color][/u]
  4. a working alternate:java script:

    function openmenu() {	var obj = document.getElementById('jobdesc');	obj.innerHTML = 'Job Description';	obj.href = 'why.htm';}

    html:

    <td class="menu" onmouseover="openmenu()"><a id="jobdesc" href="jobdescription.htm">Job Description</a></td>

  5. in:

    $result = mysql_query ("SELECT * FROM dictionary WHERE word") or die(mysql_error());

    ..."word" has no value. you need to replace it with:

    $result = mysql_query ("SELECT * FROM dictionary WHERE word='{$search_string}'") or die(mysql_error());

  6. Im building a website for a friend's company; the website is to sell mercedes model cars. im currently designing the website .. i've got a good template, but need a good logo. so far the colour scheme is dark blues and white. im not asking for someone to design me a logo, just for some ideas. i've created a few but didn't like any of them.

  7. ohh. session_destroy() has no parameters, using it will only remove YOUR session.to remove everybodies sessions .. you could create a piece of code within your script that reads a variable from either a config file or a database, for example:

    <?phpsession_start();// read from file or databaseif ($log_users_out==true) {   session_destroy();}// rest of script?>

    that MAY work, i'm not sure. I've never tried anything like it.

  8. you should use...

    session_destroy()

    that will completely destroy the session and effectively log out your users.having...

    <script LANGUAGE="JavaScript">window.location=index.php;</script>

    ...will automatically redirect the user, no matter wether there's a submit button or not. if you're wanting to only redirect your users when they click a button, you need to create a function, and run that function when the user clicks the button. if you are just wanting to automatically redirect a user, i'd use PHP:

    Header("Location: index.php");

    most likely more reliable than javascript.

  9. for each link a different random colour:

    function changecolor(id) { var links = new Array(); links = document.getElementsByTagName("a"); for (i=0;i<backgroundcolors.length;i++) {  var number = (Math.floor(Math.random()*215));  links[i].style.backgroundColor=backgroundcolors[number]; }}

    for each link the same random colour:

    function changecolor(id) { var links = new Array(); links = document.getElementsByTagName("a"); var number = (Math.floor(Math.random()*215)); for (i=0;i<backgroundcolors.length;i++) {  links[i].style.backgroundColor=backgroundcolors[number]; }}

    i've not tested them, but they should work !

  10. i don't think that's from a website, looks more like part of a program. to create something similar on a website, learn HTML for layout, CSS for styling and either PHP or ASP +MySQL for querying the database.

  11. erm, i reckon you'd need to use javascript and create an array of the songs and of the song times. then write a script to run a song after the time runs out on the previous.do you know ANY javascript?

  12. try laying the script out more simple:

    java script:R=0;x1=.1;y1=.05;x2=.25;y2=.24;x3=1.6;y3=.24;x4=300;y4=200;x5=300;y5=200;DI=document.getElementsByTagName("img");DIL=DI.length;function A() { for(i=0; i-DIL; i++){  DIS=DI[ i ].style;  DIS.position='absolute';  DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+"px";  DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"; } R++}setInterval('A()',5); void(0);

    it uses HTML DOM .. so that's probably why you don't see many of the commands you learnt.i'm guessing with it starting with "java script:" it's being stored in the element (eg. ....onclick="java script:R=0.....") so you will have to keep it as you have it now.

×
×
  • Create New...