Graphix 68 ---

Well, you can:

<form action='' method='post' onsubmit='sendRequest(); return false;'>

Keep in mind that you need to write the function yourself: retrieve all variables from the form and send them along with the AJAX request.

Also you will have to notify the user that the form is submitted by hiding the form and showing a message, else they might spam click the submit button.

~G

Graphix 68 ---

Well, you call the function calcHeight, however in your javascript code, the function is called calcheight , (notice the caption). Also your function just retrieves the height? I assume you have some code that sets the height of the iframe that you have not posted.

~G

Graphix 68 ---

What code?

Graphix 68 ---

Perhaps you could give us some code to work with? The description "the code was in js and html" is not really a full sourcecode

~G

Graphix 68 ---

Well, you added an event listener, that is triggered with the event. The event listener (= function) than does something. For example in the code you provided:

The rectangle is clicked ->
The function myDown is called ->
myDown repositions the rectangle to the center of the mouse and allows the rectangle to be dragged. Then it adds a event listener to the mouse movement (myMove) ->
Then the myMove moves the rectangle along with the mouse ->
If the mouse is up, the function myUp is called
myUp removes the mouse movement eventlistener (myMove) from the mouse movement event and stop the rectangle from being dragged

~G

Graphix 68 ---

The event argument is automatically passed on with the function, alternatively you can use:

canvas.onmousedown = function(e) {
 return myDown(e);
}

I am not yet familiar with the HTML 5 javascript methods, but it appears as if the init() function formats the canvas into a moveable object, and then redraws it every 10ms. If the user presses on the moveable object, the dragok variable is true and the canvas is moved as long as the mouse is down, which turns the dragok variable false.

~G

Graphix 68 ---

Situation 1:
The three men pay 30 pounds
(Status: 30 pounds manager/porter, 0 pounds men)

Situation 2:
The porter/manager gives back 3 pounds and keeps 2 pounds
(Status: 27 pounds manager/porter, 3 pounds men)

So you can not add up 27 + 2, as the 2 pounds are already added to the 25 pounds of the porter/manager, which brings them to a total of 27 pounds. And the men only received 3 pounds.

Edit, a better answer:

Let's say the men start off with 30 pounds and the hotel with 0 pounds:
The men have 3 pounds left
The men paid 27 pounds
The manager/porter has 2 (which the porter has in his pocket) + 25 (that the manager has) = 27 pounds
THe manager paid -27 (so he gained)

So you can't add up what the men paid with what the porter has in his pocket (which equals 29), as what the men paid is equal to what the manager and the porter have.

This is really confusing to explain ;)


Another riddle:

A home of wood in a wooded place, but built not by hand. High above the earthen ground, it holds it's pale white gems. What is it?

Graphix 68 ---

The javascript core is the same, but the objects and some other parts are different. You should check out some tutorials on it, starting with:
http://www.adobe.com/products/indesign/scripting/pdfs/InDesignCS3_ScriptingGuide_JS.pdf

~G

Graphix 68 ---

The error is triggered due to the fact that the app.document does not have a child element "body" which is in XHTML the <body> tag. Try the following:

Element.style.fontFamily

If that also triggers an error, you need to give me a bit more information about app.document and its content

EDIT: I dont know, what is "activeDocument"?

EDIT2: In one of my first posts, I posted a function named FontChange() that uses the document element (which is the active document aka the document in which the javascript code is placed/executed):

function FontChange() {

 /* Retrieving font: */
 var FontFamily = document.body.style.fontFamily;
 var FontSize = document.body.style.fontSize;
 
 /* Checking and correcting font: */
 if (FontFamily != "Present LT std") {
  document.body.style.fontFamily = "Present LT std";
 }

 if (FontSize != "18px") {
  document.body.style.fontSize = "18px";
 }

}
Graphix 68 ---

I don't know what the "app" variable is in your post, as I said when I corrected it. I am not familiar with InDesign CS3 so I assumed it was some kind of seperate window. What type of element/tag does the "app" variable represent? (I mean is it a <div>, a <span>, <p>?)

~G

Graphix 68 ---

Good job you figured that out

Graphix 68 ---

You can handle the keys pressed on the keyboard:

document.onkeypress = function(e) {
 return HandleKey(e);
}

function HandleKey(event2) {

     var key;  
     
     /* Retrieving the pressed key: */
	 
     if (window.event) {
          key = window.event.keyCode; //IE
     } else {
          key = event2.which; //firefox    
     }
	 
     /* Switching the pressed key: */
	 
     if (key == 97) {
	 
	alert("You pressed the left arrow!");
	return false;
		
     } 
	 
}

You only need to find the keycode of the "H" key.

~G

Graphix 68 ---

I thought that it was pretty obvious ;) but anyway here it is:

<DIV title='Long Term Focus' style='font-weight:bold; font-size:24px; color:green'>&#x25A0;</DIV>

~G

Graphix 68 ---
Graphix 68 ---

Line 1 - No document type?

Line 2 - You forgot to add <title>MyTitle</title> element

Line 4 to 16 - Your script needs to be either within the <head> or within the <body> tag

Line 20 - You did not add the id attribute:

<select name="box" id="box">

Line 21 - The correct syntax for having a option selected is selected="selected" (see reference)

~G

Graphix 68 ---

>> Line 18,19,20 - You forgot to end them with a ;
>> Line 19 - You can't redeclare the document object. Call it something like "element" or "AppDocument"
>> Line 20, 21, 31, 35 - Pay attention to the caption of the css property, it needs to be "fontSize" and "fontFamily" to work properly
>> Line 18 - You did not declare the variable "app"? I don't know whether that is a pre-defined variable of Indesign CS3?

~G

Graphix 68 ---

If you ask me: "does this code work?", you have not tested it out yourself at all, which is not advisable. Also commenting in JavaScript needs to be:

/* My comment */
// My comment

Anyway, the following function checks whether the body style (the style of the entire document!) is set to font family "Present LT std" and font size "18px", if it is not then sets it like that:

function FontChange() {

 /* Retrieving font: */
 var FontFamily = document.body.style.fontFamily;
 var FontSize = document.body.style.fontSize;
 
 /* Checking and correcting font: */
 if (FontFamily != "Present LT std") {
  document.body.style.fontFamily = "Present LT std";
 }

 if (FontSize != "18px") {
  document.body.style.fontSize = "18px";
 }

}

You should really read up on how to write JavaScript, it is not that difficult:
http://www.w3schools.com/js/default.asp

~G

Graphix 68 ---

You can modify the styles of elements easily:

Let's say you have some have an element with some text:

<span id='my_text' style='font-family:Arial;'>Some text</span>

Then you can use JavaScript to change its font family:

document.getElementById("my_text").style.fontFamily = "Times New Roman";

For all CSS properties and how to use them in JavaScript, see:

http://www.w3schools.com/CSS/pr_font_font-family.asp
(look at the JavaScript Syntax in the information table)

And look around the site for other CSS properties and how to use them

~G

Graphix 68 ---

Do you mean that the form is loaded without the page being refreshed/changed or with the page refresh?

Anyway, if the page is refreshed after the user pressed the button, you can just simply retrieve the form values using PHP and then echo that as values inside the full form:

// Retrieving the form values of the small form:
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];

// Echoing them inside the full form:

echo "First name: <input type='text' name='firstname' value='".$firstname."' />";
echo "Last name: <input type='text' name='lastname' value='".$lastname."' />";

// The rest of the form:

echo "Address: <input type='text' name='address' value='' />";
echo "Zip: <input type='text' name='zip_code' value='' />";

Or if you want the full form to show up dynamically (without page refresh) you will need to write a JavaScript function that either shows the rest of the form (which is hidden untill the button is pressed) or that retrieves the form values of the small form and then inserts them into the full form and then focusses the first input field within that form.

You can retrieve values using JavaScript with the following function (the id of the text input also needs to be set on 'lastname', just like its name):

var LastName = document.getElementById('lastname').value;

~G

Graphix 68 ---

Executing a file on your system, via javascript is only possible when people use Internet Explorer (as it is like a swiss cheese when it comes to security):

http://www.tek-tips.com/viewthread.cfm?qid=1226233&page=1

~G

Graphix 68 ---

The message will only pop up if you are submitting a form from the secure https://* page to the http://* page. If you do not submit a form, and just redirect the user using a header() or a regular <a> element, the warning you described will not be shown.

~G

Graphix 68 ---

I think it is waiting for the the AJAX response for retrieving your email, and as this is alot of information and there are ALOT of people doing that on the same moment, it takes some time before it all is retrieved :)

Progress bars are only for the entertainment for the clients so they don't get bored when something takes a while ;) (and makes sure they don't think it isn't working when the page is blank)

~G

Graphix 68 ---

>> How can I learn JavaScript?

Follow the tutorial on the the website below:
http://www.w3schools.com/js/default.asp

And when you have finished it you know the basics of the language.

>> Is there any other way of building the menubars without the use of javascript?

Yes there is, by using CSS:

http://www.google.com/search?q=css+menubar

>> Can I learn JavaScript within a few days?

Only the basics, I think you can learn the entire language within two weeks or so if you are really dedicated :)

~G

Graphix 68 ---

Check whether the productid is already inserted in the jsp page and if it is don't add another record and if it isn't insert it?

Graphix 68 ---

As soon as you wrote some code or post code you already have to do the thing you described and stumbled upon a problem, let me know by posting it below and I will be happy to point you in the right direction to get your code working

~G

Graphix 68 ---

You probably ment the following function:

function chn(){

  /* Retrieving text to be hashed: */
  var text = document.getElementById('txt1').value;
 
  /* Hashing text: */
  var hash = $.md5(text);

  /* Showing hash: */
  document.getElementById('txt2').value = hash;

}

~G

Graphix 68 ---

You need to encase your code in code tags, one that opens, one that closes (without the spaces between the []):

[CODE ] Some code.... [/CODE ]

Anyway, on to your code:

  • You misspelled getElementById by changing the 't' into a 'd'
  • You kind of messed up the brackets in the CheckAnswer() function

The code was written OK, so my complements for that ;) I adjusted the code a bit so that it is more commented and spaced:

<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Math Quiz</title>
</head>
<body>

<script type='text/javascript'>
var PlayerWins = 0;
var PlayerLosses = 0;

function CreateRandomNumber() {

  /* Calculating and returning random number between 0 and 100 */
  return Math.floor(Math.random() * (100 + 1));

}

function CreateRandomOperator(){

  /* Calculate random number between 0 and 1 */

  var Operator = "";

  var val = Math.floor(Math.random() * (1 + 1));

  if(val == 0) {
    Operator = "+";
  } else if (val == 1) {
    Operator = "-";
  }

  return Operator;

}

function CheckAnswer() {

  /* Retrieving the two numbers and the player's answer: */
  var Number1 = parseInt(document.getElementById('Number1').innerHTML);
  var Number2 = parseInt(document.getElementById('Number2').innerHTML);
  var Operator = document.getElementById('Operator').innerHTML;
  var Player_Answer = parseInt(document.getElementById('Player_Answer').value);

  /* First you check whether the answer is correct: */

  if (Operator == '+') {

    if(Player_Answer == Number1 + Number2){

        PlayerWins++

        /* Showing status: */
        alert('Correct answer!\nWins:' + PlayerWins + '\nLosses:' + PlayerLosses);

    } else if (Player_Answer != Number1 + …
Graphix 68 ---

If you want to add other operators such as - / % etc, you need to replace the normal + in the form into:

<span id='Operator'></span>

And then adjust the CheckAnswer() function by adding the following to the part where you retrieve the values:

var Operator = document.getElementById('Operator').innerHTML;

Then you adjust the part where it checks for the correct answer:

if (Operator == "+") {
 ... Check the answer with the addition value
} else if (Operator == "-") {
 ... Check the answer with the substraction value
}

And so on for every operator!

But this also means you will need to adjust the CreateNewQuestion() function, as this now will also need to randomly pick a operator, so you will need to add a function to the entire script named CreateRandomOperator() which calculates a random number (for example 0-2) then returns a operator depending on what number is picked (so 0 = addition (+), 1 = substraction (-), 2 = division (/) etc...) and return that.

When you made that function, you need to make a adjustment to the CreateNewQuestion() :

function CreateNewQuestion() {

 var New_Number1 = CreateRandomNumber();
 var New_Number2 = CreateRandomNumber();
 var New_Operator = CreateRandomOperator();
 
 /* Loading the new numbers into the elements: */
 document.getElementById('Number1').innerHTML = New_Number1;
 document.getElementById('Number2').innerHTML = New_Number2;
 document.getElementById('Operator').innerHTML = New_Operator;

}

The above is the answer to your first post, to answer your second question: you can include JavaScripts in your html page by adding the following in either …

Graphix 68 ---

Hi and welcome to DaniWeb!

When posting code, always make sure you put it between CODE tags:

Some code...

Now onto your problem:

You are starting off with jQuery before you even understand how JavaScript works. jQuery is an extension of JavaScript, making writing it easier.

As you have a question about the JavaScript/HTML of the page, the CSS you added on the bottom is not necessary.

I would recommend starting with JavaScript and then move to jQuery after you understand how it all works.

Below is an example on your project written in clean JavaScript, which is a bit more easy than jQuery:

<!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" xml:lang="en" lang="en">
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 <title>Asteroids</title>
</head>
<body>

<script type='text/javascript'> 
var PlayerWins = 0; 
var PlayerLosses = 0;

function CreateRandomNumber() {
 
 /* Calculating and returning random number between 0 and 100 */
 return Math.floor(Math.random() * (100 + 1));

}
 
function CheckAnswer() {

 /* Retrieving the two numbers and the player's answer: */
 var Number1 = parseInt(document.getElementById('Number1').innerHTML);
 var Number2 = parseInt(document.getElementById('Number2').innerHTML);
 var Player_Answer = parseInt(document.getElementById('Player_Answer').value);
 
 if (Player_Answer == (Number1 + Number2)) {
 
  /* If the player's answer is correct: */
  
  /* Increasing wins: */
  PlayerWins++;
  
  /* Showing status: */
  alert('Correct answer!\nWins:' + PlayerWins + '\nLosses:' + PlayerLosses);
  
  /* Creating new question: */
  CreateNewQuestion();
  
 } else if (Player_Answer != (Number1 + Number2)) {
 
  /* If the player's answer is incorrect: */
  
  /* Increasing wins: …
Graphix 68 ---

Using live search is a bit difficult to get working when it is your first AJAX related project, but anyway, here are some tips:

- First test whether the PHP page shows the correct HTML, by just visiting the PHP page in your browser and adding the GET variable manually:

liveresults.php?z=my+search+query

- Once that is working correctly, first make a simple function that alerts the variables you retrieve from the elements and call that first instead of directly start with the AJAX function (This step does not apply to you, as the variable is passed on by argument)

- Make the AJAX function and let it alert every step of the code, including whether the function is called at all, check the URL it is calling, what status and readystate it receives and what the responseText is

- When that is also working correctly, the problem should be solved ;) if not post below where it all went wrong

~G

Graphix 68 ---

Alright, I guess you stopped reading my posts which provided the solution and which only need one more adjustment to work with the table you described in your last post. Finding a solution when you show no effort on solving your OWN problem and use youtube films to learn PHP, is not going to work...

Good luck.

Ezzaral commented: Agree +14
Graphix 68 ---

I adjusted the code so that it should work, pay attention to the changes I made that I typed out in my first post:

<body>

<form  method="post" action="new.php" /> 
  <label>TYPE: 
  <select name="field"> 
    <option value="sid">StudentID</option> 
    <option value="sname">StudentName</option> 
  </select> 
  </label> 
  <label>WORD: 
  <input type="text" name="searchword" /> 
  </label> 
  
  <input type="submit" name="submitted" /> 
  
</form> 

<?php 

/* If the form is submitted: */

if (isset($_POST['submitted'])){ 

 /* Connecting to the database: */

 $con = mysql_connect("localhost","root",""); 

 mysql_select_db("uni", $con) or trigger_error('MySQL error: ' . mysql_error());  

 /* Retrieving form values: */

 $searchword = htmlentities(addslashes($_POST['searchword']));
 $field = htmlentities(addslashes($_POST['field']));
 $searchword = htmlentities(addslashes($_POST['searchword']));

 /* Executing search query: */

 $query = "SELECT * FROM student WHERE ".$field." = '".$searchword."'";
 $result = mysql_query($query) or trigger_error('MySQL error: ' . mysql_error());  
 
 /* Showing search results: */

 if (mysql_num_rows($result) > 0) {

  /* If the amount of rows is bigger than 0: */

  echo "<table>"; 
  echo "<tr><th>StudentID</th><th>StudentName</th></tr>"; 

  while($row = mysql_fetch_array($result)){ 

    echo "<tr><td>"; 
    echo $row['sid']; 
    echo "</td><td>"; 
    echo $row['sname']; 
    echo "</td></tr>"; 

  } 

  echo "</table>"; 

 } else {

  /* If no records were found: */
  echo "You search query did not match any record.";

 }

 mysql_close($con); 

} 
?>
</body>
</html>

~G

Graphix 68 ---

You can redirect visitors after you processed the form (around line 175) using the Header() function:

header('Location: http://www.example.com/');

See the reference: http://php.net/manual/en/function.header.php

~G

Graphix 68 ---

>> Line 1 - There is no attribute for the form tag called 'value'

>> Line 4, 5 - Do not use spaces between attributes and their values (so value = "sid" needs to be value="sid" )

>> Line 12 - Add a attribute "name" with the value "submitted" to the submit element, else the if statement on line 17 does not work correctly

>> Line 25, 26 - This is not an error but if the code goes online, it can be exploited by adding SQL code into the value of the form elements, clean it up before adding them to the query:

$searchword = htmlentities(addslashes($_POST['searchword']));

>> Line 48 - You need to place this line within the if statement brackets, as there only is a connection when it has been openend on line 19

~G

Graphix 68 ---

You can in fact make a timer (= interval) that increments the variable 'play_time' every second, untill it reaches the end of the length of the song. Then it resets the play_time and load a new song. I am not sure how you play the song, so you need to incorporate that yourself:

var play_time = 0;
var current_song = 0;
var song_amount = 2;

var songs = new Array;

songs[0] = new Array;
songs[0]['length'] = 180; // In seconds
songs[0]['title'] = 'Song name0'; // Title of the song

songs[1] = new Array;
songs[1]['length'] = 230; // In seconds
songs[1]['title'] = 'Song name1'; // Title of the song

function HandleMusic() {

  if (play_time == songs[current_song]['length']) {

   /* Here you will have to place the code that plays the music.... */
   // Something like another function named PlaySong(song_id)

   /* Going to next song if it exists, else return to the first: */
   if (current_song != (song_amount - 1)) {
    current_song++;
   } else {
    current_song = 0;
   }

   /* Resetting play time: */
   play_time = 0;

  } else {

   /* Increasing play time: */
   play_time++;

  }
}

window.onload=function() {
setInterval(function(){
HandleMusic();
}, 1000);
}

~G

Graphix 68 ---

Rounded corners is difficult if you want the browser to make it, but you can just simply use a image as background, that has rounded corners:

.Button2 {
background-image:url('images/button_out.png');
background-color:none;
border:0px solid red;
padding:0px;
width:100px;
height:20px;
}
.Button2:hover {
background-image:url('images/button_on.png');
background-color:none;
border:0px solid red;
padding:0px;
width:100px;
height:20px;
}

Also when you dont want to use a image, use regular CSS for it:

.Button1 {
font-family:Arial;
font-size:13px;
padding:2px;
border:1px solid white;
background-color:navy;
width:100px;
height:20px;
}
.Button1:hover {
font-family:Arial;
font-size:13px;
padding:2px;
border:1px solid navy;
background-color:white;
width:100px;
height:20px;
}

~G

Graphix 68 ---

You have alot of typo's in your HTML:

<a href="chapman/IMG_1626 copy.jpg" rel="lightbox" </a><img border="0" src="http://www.phughesphotography.com/chapman/IMG_1626 sm.jpg" align="center" width="200" height="133"></a>

Needs to be:

<a href="chapman/IMG_1626 copy.jpg" rel="lightbox"><img border="0" src="http://www.phughesphotography.com/chapman/IMG_1626 sm.jpg" align="center" width="200" height="133"></a>

I did not take a look at your lightbox code, but I assume it works....

~G

Graphix 68 ---

There is no such thing as AJAX for Java programmers...

Perhaps you ment AJAX for JavaSCRIPT programmers???

Use Google (http://www.google.nl/search?q=ajax+tutorials), as that is why it was invented:

http://www.w3schools.com/Ajax/Default.Asp

~G

Graphix 68 ---

Ok your problem lies in the following two functions:

function ozn(opcija,id){
document.getElementById(id).style.background="rgb(167,120,50)";
document.getElementById(id).onclick=function(){mak('+opcija+',this.id);}
urediFont(opcija);
}

function mak(opcija,id){
document.getElementById(id).style.background="rgb(199,147,69)";
document.getElementById(id).onclick=function(){ozn('+opcija+',this.id);}
urediFont(opcija);
}

They need to be changed into:

function ozn(opcija,id){
document.getElementById(id).style.background="rgb(167,120,50)";
document.getElementById(id).onclick=function(){mak(opcija,this.id);}
urediFont(opcija);
}

function mak(opcija,id){
document.getElementById(id).style.background="rgb(199,147,69)";
document.getElementById(id).onclick=function(){ozn(opcija,this.id);}
urediFont(opcija);
}

~G

PS: I do not have any clue which language this is, so all the variables names are confusing to me. Perhaps program in english so your code is more understandable to people. Just a suggestion for in the future ;)

Graphix 68 ---

When the user selects a text, he can press the 'B'-button to bold and to unbold the selected text. However, when he presses the 'B'-button without having the text selected, the user can enter text which will turn up bold. If the user wants to stop with this, he can unbold by clicking the 'B'-button.

~G

Graphix 68 ---

Ivan, I see you used the tutorials I gave you to make a rich text editor, but you did not copy them correctly. For instance, line 9 and 10, you neglected to close the <body> and <html> tag, which is probably causing your problems.

If you want to change the background color of the selected text, you just simply use the following:

urediFont('BackColor', 'blue');

For a complete reference see:
http://msdn.microsoft.com/en-us/library/ms533049%28v=VS.85%29.aspx

I would highly recommend that you read through my tutorial again:
http://www.webdevproject.com/projects/solo/project31.html

Also, commenting/indenting on your code is advisable, as we can then understand the code alot better. (Code guidelines)

~G

Graphix 68 ---

Yes it is ;)

You basically set session variable in which you declare various levels of authorization:

$_SESSION['LOGINDATA']['AUTH'] = 2; // 0 = guest, 1 = member, 2 = admin

And then you check on any page what to show:

switch ($_SESSION['LOGINDATA']['AUTH']) {

 case 0 :
  echo 'You are a guest';
 break;

 case 1 :
  echo 'You are a member';
 break;

 case 2 :
  echo 'You are a admin';
 break;

}

And if you need to check on a random page, to show a login message or not:

if ($_SESSION['LOGINDATA']['AUTH'] > 0) {
  echo 'You are not logged in, <a href="login.php">log in</a>?';
}

Also you need to add this to the top of you page, to make sure if the login session data is not set, you set it to default:

if (!isset($_SESSION['LOGINDATA']['AUTH'])) {

 /* Setting default value: */
 $_SESSION['LOGINDATA']['AUTH'] = 0;

} else {

 /* Converting the value to an integer, to prevent errors: */
 $_SESSION['LOGINDATA']['AUTH'] = intval($_SESSION['LOGINDATA']['AUTH']);

}

~G

PS: You always need to start a session at the top of every page ( session_start() )

Graphix 68 ---

It's not the fault of the HTML nor CSS, if you would read the sourcecode, you would see that after every dot (.) there is a unknown character icon. This is caused by your editor that you use to type the text (your CMS perhaps), which adds a unknown character after every dot.

~G

PS: You should validate your CSS using w3 CSS validator, on first glance, I saw that line 5 should be: font-style:none;

Graphix 68 ---

Line 22, 33, 35, 37, 44 - You forgot to close the quotes

~G

Graphix 68 ---

If you want to use two different DB connections, you need to start using the mysqli functions instead of the mysql functions. In the mysqli functions you need to specify which database connection you use to execute the queries and functions. Also, when selecting a database always use a or die() statement behind it:

$link = mysql_connect('localhost', 'mysql_user', 'mysql_password') or die("Could not connect to MySQL.");
$dbselect = mysql_select_db("mysql_database", $link) or die("Could not select MySQL database.");

~G

Graphix 68 ---

A) This is not the existing scripts forum
B) Send an email to the person that wrote this script and ask him to answer your question
C) The code is extremely unreadable, unclear and confusing. As I did not wrote the code, I have no idea what it does. It does not even have any comments.

I assume you did not wrote this script, and if you do you'd better improve your programming skills ;) (Code Guidelines: http://www.webdevproject.com/guides/programming/guide2.html)

~G

Graphix 68 ---

When you want to darken a page, you place the following HTML right after the <body> tag:

<div id='darkscreen' style='position:fixed; top:0px; left:0px; color:black; opacity:0.5; filter:alpha(opacity=50); width:100%; height:100%;'></div>

If you want to toggle its display, you can use:

document.getElementById('darkscreen').style.display = 'inline'; // Show
document.getElementById('darkscreen').style.display = 'none'; // Don't Show

~G

Graphix 68 ---

Making the converter can be done in JavaScript, like you showed on the link you added. I'il give you a head start on how to:

You have two text inputs, I already made the first for you:

The currency you have: <select id='have_cur_type' onchange='NewHaveCurType(this.value)'><option value='euro'>Euro</option><option value='dollar'>Dollar</option></select><br />
The amount you have: <input type='text' id='have_cur_amount' value='0' />
<br />
<br />
<input type='button' onclick='Convert()' value='Convert Currency' />

And then you have the javascript:

var have_cur_type = 'euro';
var need_cur_type = 'euro';

function NewHaveCurType(type) {
  have_cur_type = type;
}

function Convert() {
  
  var have_cur_amount = document.getElementById('have_cur_amount').value;
  // Also retrieve the other...
  
  // Now you need to calculate the ratio from one currency to the other, I would advise if you would first translate them all to one currency for example dollars and then translate those into the final currency the user wants

}

~G

Graphix 68 ---

Before I forget, I also decided to make a tiny editor myself after your question with an API etc. (but release date is about two weeks from now ;) ) but before I started my own, I created a tutorial on how to do make a tiny editor (aka a rich text editor). You might want to check it out:

Link to the tutorial on how to make a rich text editor WYSIWYG:
http://www.webdevproject.com/projects/solo/project31.html

~G

Graphix 68 ---

There is nothing tiny about it ;)

References and tutorials on developing rich text editors are rare and extremely difficult to find (I never found one till today). You should check out the open-source rich text editors and try to understand what they do in the sourcecode.

An example of an open-source WYSIWYG editor:
http://nicedit.com/

Try googling though to find the (maybe) one tutorial on the web on this subject? If you found it, feel free to post it below for others (including myself)!

EDIT:

Finally found one: http://www.webreference.com/programming/javascript/gr/column11/

EDIT2:

This one is better: http://www.geekpedia.com/tutorial198_Creating-a-Rich-Text-Editor-using-JavaScript.html

~G