Jump to content

pudge

Members
  • Posts

    11
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://www.pudgeware.co.uk/asp/home.asp

pudge's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. pudge

    Constant Refreshing

    ...could you expand on that? I tried skimming through the w3 tutorial, but i could only see examples where the code was refreshed each time you typed something in. i need the single line of code to be refreshed all the time. (which is why i havent used the meta tag that reportingsjr told me about, because it refreshed the entire page over and over again, which defeated the object as it stopped you from being able to input anything in the boxes without it refreshing and getting rid of what you've typed in before you can submit. As for the header idea, i couldn't get it to work. i assume it is supposed to be inserted into php script, what with the semi-colon at the end. thanks for the ideas though)
  2. pudge

    Constant Refreshing

    You may or may not have read my previous post about the file_put_contents command in a shoutbox. Well, I gave up on that idea, as i believe the problem may be that I do not have the right PHP version, so i am now using the fopen(), fwrite() and fclose() commands. It is all working pretty good except that the file_get_contents() command needs to refresh about every second or so. Any ideas on how i can do that?
  3. BTW, you may want to do something about the source code. Simply by looking at it quickly i noticed that the second input (the hidden one, named guess) has the value of the number you're supposed to guess. I'm no expert on making script hidden, but theres probably a way of containing the value in PHP, and as PHP doesnt show up when you click view source, you wont be able to see what it is
  4. I'm still very new to php and I dont completely know what i'm doing. I've had a go at making a very crude and simple shoutbox type page, but it really isnt working well. I have two files in the same folder on my website called "shoutbox1.php" and "shoutbox1.txt". My plan is to send a line of text to the bottom of the .txt file from the .php file, then have a file_get_contents command to retrieve all of the text from the .txt file. I dont know if this method will work at all, but the script i've come up with for "shoutbox1.php" so far is as follows <html><body><form action="shoutbox1.php" method="post">Name : <input type="text" name="name" /><br>Message : <input type="text" name="message" /><br><input type="submit" value="Submit" onclick="send()"><br></form><br><?php$name=$_POST["name"];$message=$_POST["message"];function send(){echo file_put_contents("shoutbox1.txt","<br>" . $name . " Says : " . $message . "<br>","FILE_APPEND");}?><table border><tr><td><?php echo file_get_contents("shoutbox1.txt");?></td></tr></table></body></html> All of it seems to work fine except the line : echo file_put_contents("shoutbox1.txt","<br>" . $name . " Says : " . $message . "<br>","FILE_APPEND"); I tried many different ways of using this command, including inputting a message without the variables, taking it out of the function, getting rid of the FILE_APPEND and several others ideas to try and make it work, but the line has not worked once yet.
  5. pudge

    firefox redirection

    my website contains quite a few vbscript based mini games, and all my friends who use mozilla firefox are getting annoyed because they cant use them. so i remade them with asp but they arent as good, so i want to be able to redirect firefox users to the asp version of the game, and keep vbscript ready browsers on the original game. to do this i made this script in the original game file : <%set mybrow=server.createobject("mswc.browsertype")if MyBrow.vbscript("true") then response.redirect("http://www.pudgeware.co.uk/asp/s_list/mini_game.asp")else response.redirect("http://www.pudgeware.co.uk/asp/s_list/mini_game1.asp")end if%> (where mini_game.asp is the vbscript version, and mini_game1.asp is the asp version)I found that this script worked perfectly on Internet explorer, even when i switched around the outcomes (so that vbscript ready browsers would go the asp version of the game). unfortunately, for some reason, the script doesnt work for firefox users, which i cant understand as the script runs server side, and works perfectly well with internet explorer. All the link are correct, and the error comes up as # Error Type:Sun ONE ASP VBScript runtime (0x800A000D)Type mismatch/asp/s_list/rpg_name_generator.asp, line 2line two is the 'if mybrow.vbscript("true") then'
  6. pudge

    Redirecting page

    nvm, i completely rewrote the script, and it works now : <%dim Returnreturn=Request.cookies("return")if return<>"" then Response.redirect(return)end ifif Request.Form("select")<>"" then if request.form("choice")=1 then response.cookies("return")=(request.form("select")) Response.Redirect(Request.Form("select")) else Response.Redirect(Request.form("select")) end ifend if%> <html><body><form action="index.asp" method="post"><input type="radio" name="select" value="/asp/home.asp">ASP version (recommended)<br><input type="radio" name="select" value="/html/home.htm">HTML version<br><br>Remember choice?<br><input type="radio" name="choice" value="1">Yes<br><input type="radio" name="choice" value="2">No<br><br><input type="submit" value="Go!"></form></body></html>
  7. translated its something along the lines of 'Do not use authority'. thats what i got when i translated it from chinese to english on google translator, but you can never completely rely on them, you really need a human translator.
  8. pudge

    Redirecting page

    my website is currently split almost into two halfs, one made up completely of html, and the other made up from asp. To let the user decide which part of my website they want to use, i tried to make a page which would redirect them depending on their choice, and also save their choice in the form of a cookie, so when they came back onto the website, it would automatically redirect them depending on their original choice. Unfortunately, it didnt work, probably becuse im still quite unsure about things like syntax, and exactly how asp works.heres what i what came up with so far : <%response.cookies("choice")="0"%><html><head><%If request.cookies("choice")="1" then Redirect("http://www.pudgeware.co.uk/asp/home.asp")else if request.cookies("choice")="2" then Redirect("http://www.pudgeware.co.uk/html/home.htm")elseend if%></head><body>Choose which version of PudgeWare you would like to go to<br><form name="myform"><select name="version"><option value="1">ASP (recommended)</option><br><option value="2">HTML</option><br></select><br>Remember choice each time you visit?<br>Yes<input type="radio" name="choice" value="yes" checked><br>No<input type="radio" name="choice" value="no"><br><input type="button" name="submit" value="Submit"> </form><script type="text/vbscript">sub submit_onclick()dim optchoicedim recchoiceoptchoice=myform.version.valuerecchoice=myform.choice.valueif recchoice = "yes" then if optchoice = "1" then <%response.cookies("choice")="1" Redirect=("http://www.pudgeware.co.uk/asp/home.asp")%> else <%response.cookies("choice")="2" Redirect=("http://www.pudgeware.co.uk/html/home.htm")%> end ifelse if optchoice = "1" then <%Redirect=("http://www.pudgeware.co.uk/asp/home.asp")%> else <%Redirect=("http://www.pudgeware.co.uk/html/home.htm")%> end ifend ifend sub</script></body></html> when i go on it, it comes up with the following error message: The page cannot be displayed There is a problem with the page you are trying to reach and it cannot be displayed. Error Type:Sun ONE ASP VBScript compilation (0x800A03F6)Expected 'End'/index.asp, line 45, column 24
  9. Is it possible to send data (in the form of a piece of text) to a .inc file using a form in a .asp file, whilst still staying on the same page, and then recalling it again. The recalling it shouldnt be too much of a problem, its just that although i read through the tutorial quite a few times, i just cant get the hang of sending information to another file.Im still very new to using .asp.
  10. so you're saying i just need to make a file with .asp at the end, upload it onto my website, add in some code, then check that it works by looking at it in a browser. sounds easy enough.thanks
  11. I'm planning on using ASP in my website (which is being hosted on a web hosting service), as i've just learnt VBScript, and i'm planning on adding some more interactive script. Unfortunately, after reading through the w3schools tutorial, i couldnt figure out how to even get started.I'm guessing that to start i need to be able to make some files with a .asp extension, but i'm not sure how exactly i am supposed to do that. Whats more, im using a computer that runs on XP home edition, so i dont think i can use an IIS, which i'm guessing is kind of essential.If anyone can run me through this whole ASP thing from the start, in very simple, easy to understand words, i would be pretty grateful.
×
×
  • Create New...