View Full Version : Substitute a name


luvizaverb
06-18-2004, 07:18 PM
I am trying to figure out how to place someone's name on the page. For example, my website will have stories for kids to read but I would like it to include his/her name in the story. I was wondering how to set up a page so the kid could type his/her name in the box then for the rest of the story have his/her name for the main character. It is sorta like when you are sending a e-card and you put your name and the other person's name somewhere in the card to make it personal. Also I would like to have a place where they can state if he is a boy or she is a girl so the characters can refer the reader as a boy or girl. Could you help me figure out how to do this?

dolce shanti
06-18-2004, 07:40 PM
I think that, if this is what you are talking about, you put this wherever you want the name to show up:

<script language="javascript">
<!--
var namePrompt=prompt("What Is Your Name","");
function dispname(namePrompt) {
document.write(""+namePrompt+"");

}
{dispname(namePrompt);
}
//-->
</script><br>


A box will pop up when the visitors arrive asking for their name.

horse*chica
06-18-2004, 07:49 PM
I have no idea at all how to do that, but it sounds like PHP will be needed somewhere. So first, do you have access to PHP on your site? (i.e., Geocities won't work)

dolce shanti
06-18-2004, 09:30 PM
No...I don't think so. You could try pasting the script onto your page to see if it would work.

luvizaverb
06-18-2004, 11:46 PM
To be honest, the website I am designing is not yet on the web. I've helped with a website before but I only know the very basics. I just wanted to put it together on my computer first then if it works I will find a server. I copied and pasted the code I saw in a reply, but I still need the code on the page for the person to type his/her name. Don't worry about giving me the code for he/she to pick his/her gender. I will just write the stories in two formats because I will change the characters personallity based on his/her gender.