Jump to content

Xanco

Members
  • Posts

    11
  • Joined

  • Last visited

Xanco's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello peoples. I am trying to write a php script that connects to a database then selects data depending on user input. However, it's more than likely that the user will get more than one result, and I cannot say how many they're going to get. Is there anyway that I can just generate variables, store them and use them on another page? Like for example: The user searches for Joe, the variables would be: Name_1 = ... Name_2 = ... Name_3 = ... But if another user searches John the variables would be: Name_1 = ... Name_2 = ... Name_3 = ... Name_4 = ... Name_5 = ... How can I do this? Thanks, Xanco
  2. Hello peoples. Right, what I'm trying to do is; you fill out a form that generates a HTML page (done with no problems) but you want to preview it before. So essentially, what I'm trying to do it submit a form, but opening another window in doing so, meaning that the entered information on the 1st page stays the same. Here's the code I'm trying: <form action="store_it.php" method="post" id="contact"> <fieldset> <label for="name" >The title of your page:*</label> <input type="text" name="name" value="<?php echo $name; ?>" placeholder="My project" id="name"> <br><label for="body" title="You may use HTML code in this box">The text for your page:*</label> <textarea onfocus="window.lstText=this;" name="body" value="<?php echo $body; ?>" id="body"></textarea><br> <input type="submit" value="Submit" name="submit" class="button" id="submit"><br> <input type="submit" value="Preview" onclick="window.open('store_it.php')"><br> </fieldset> </form> - Thanks, Xanco
  3. Hello peoples. Right, here's what I'm trying to do; the player fills in 2 forms, then those entries are to be saved as javascript variables and printed into a textarea, along with some other text. This will go onto creating a link in HTML. I want these variables: var address= document.getElementById('address'); var webname= document.getElementById('webname'); To be inserted into a text area, Here's my full function: function insertaddress(){ var address= document.getElementById('address') var webname= document.getElementById('webname') insert (window.lstText,'<a href=') insert (window.1stText, var address) insert (window.1stText, '>') insert (window.1stText. var webname) insert (window.1stText. '</a>') document.getElementById("webaddressenter").style.display="none"; } And here's my form: <form id="webaddressenter" style="display:none;"> <label for="address">Your URL:</label> <input type="text" name="address" value="" placeholder="http:www.google.com" id="address"/><br /> <label for="webname">Website name:</label> <input type="text" name="webname" value="" placeholder="Google" id="webname"/><br /> <input type="button" value="submit" onclick="insertaddress()" id="tag" /> </form> Can you see what I need to do ? - Thanks, Xanco.
  4. Hello peoples. Right, here's what I'm trying to do; the user fills out a form (that inserts a link in HTML for them), in this form there are to variables ($address and $webname). These are then saved, then are combined with javascript to produce the following in a text area: <a href=$address>$webname</a> but instead I get this: <a href=></a> Here's my php code stating the variables: $address = empty ($_GET["address"]) ? "" : $_GET["address"]; $webname = empty ($_GET["webname"]) ? "" : $_GET["webname"]; Here's my form: <form id="webaddressenter" style="display:none;"> <label for="address">Your URL:</label> <input type="text" name="address" value="<?php echo $address; ?>" placeholder="http:www.google.com"><br /> <label for="webname">Website name:</label> <input type="text" name="webname" value="<?php echo $webname; ?>" placeholder="Google"><br /> <input type="button" value="submit" onclick="insertaddress()" id="tag"> </form> Here's my javascript function function insertaddress(){ insert(window.lstText,'<a href=<?php echo $address ?>><?php echo $webname ?></a>') }
  5. Hello peoples. I have a div, id=body, which is constantly changing. How can I save what is in the div is a php variable, to use on the next page? - Thanks, Xanco
  6. Let me explain. My website will create a file (which I need to be a HTML file), but it create a file with no extension. My code above is naming that file. - Thanks, Xanco
  7. Hello peoples. You may of been my question before, regarding the same issue. I, however, cannot seem to make my string end in .html. Here's the code: $file = md5( time().'' ); This does create a random sting, which I am using to generate links, like so: mywebsite.com/ffwjiafqoapwdlc. But I want it to end in .html: mywebsite.com/ffwjiafqoapwdlc.html. Is there anything I can do to get this result? - Thanks, Xanco
  8. Hello peoples. Right, this is what I'm trying to do; I'm trying to make a php script that generates a html file. I've almost got it. I just need to finish giving the html file a name. The name will be a random number, but I need it to have .html at the end (obviously). Anybody know how I can do that? Here's what I tried (might give you some idea of what I'm doing): $file = rand()AND".html"; $file = rand()+".html"; $file = rand()".html"; - Thanks, Xanco
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.