Jump to content

jhecht

Members
  • Posts

    608
  • Joined

  • Last visited

Everything posted by jhecht

  1. ok to Flic: onsubmit=" return check()" Would be how you do it, i already know that you figured it out but still, its kinda sad when you have to go through all of this and end up doing fixing the problem on your own because the people who were helping you decided to start arguing.To the people who were arguing: PM-ing is meant for that. So are AIM, YAHOO, and MSN along with Gtalk. this person came here looking for help, not a debate. To make HTML valid by any means, yes you do need the (/) in the input tags, its just bad practice to not do. Also, onsubmit works if say someone is in the textbox writting something, and accidentally hits enter. Onclick only works when someone hits the button, and i dont know about you but i VERY rarely actually use the mouse to hit the submit button.Sheesh.
  2. Modified original post, please look.
  3. put it in the url the right way would help.http://mysite.com/page.php?user=#;in PHP use this $_GET['user']; Notice that the stuff inside the [ and ] is the same thing as after the ? in the base url.
  4. jesh pretty much nailed it on the head,if you need to you could set the cookie witht he unix timestamp of the time they visited and then use Js's DATE object to get the variables from there, but hey your choice.
  5. are you saying that you have a text box, and when you type something into it and hit submit the text is inputted into javascript and it then redirects to a seperate page depending on what you type, or does it redirect you to a part of the page you are already on?and if you want javascript to submit when a button is clicked: <input type="button" onclick="jsFunction(document.formname.fieldname.value)" value="Submit"/>
  6. proxy if you must. but this is not a coding thing.projectbypass.com would do.
  7. use stripslashes() instead of addslashes...addslashes escapes characters that would normally not be printed out to the browser. So addslashing a slash, means that the slash originally there would be echoed instead of just the punctation mark.And opendir is nice, but kinda long. use glob(); <?php$globText = "directoryName/*;foreach(glob($globText) as $value){echo $value."<br/>\n";}This will find every file under the directory "directoryName';?>
  8. jhecht

    Modifying Pages

    in reply to the characters not being able to store more than 255 bytes in a database, you can just use text and alter the table to a FULLTEXT (means it just stores what you put in it pretty much, just in case you have some REALLLY LOOOOOONG posts)
  9. I dont have a problem about javascript(at the moment), im just writting down some functions i use as bases when i use an AJAX program so that others can use it as well and aren't so lost when all of us on here talk about AJAX coding and so on Javascript file<script type="text/javascript"><!--function createRequestObject() { var ro; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ ro = new ActiveXObject("Microsoft.XMLHTTP"); }else{ ro = new XMLHttpRequest(); } return ro;}var updateId = createRequestObject();function ajax(argument) { updateId.open('GET', "show.php?argument="+argument); updateId.onreadystatechange = handleConts; updateId.send('');}function handleConts() { if(updateId.readyState == 4){ document.getElementById("div_id").innerHTML=updateid.responseText; }}//--></script> show.php<?phpif(isset($_GET['argument'])){//Same name as the thing after the ? in the javascript, right? $arg = (int)$_GET['argument']; $sql = "SELECT * FROM table WHERE user_id=$arg"; $ans= mysql_query($sql) or die(mysql_error()); while($res = mysql_fetch_array($ans)){ echo " Welcome ."$res['user_name']." ! <br/>\n"; } }else{echo "Argument Variable not set.<br/>\n";}?>This echoes out a username from a database given by a user_id passed through the argument variable in show.php. Added by request. By changing the script around a little bit you can suit this to do anything you need pretty much.
  10. Whats the code supposed to do and why would you need Also, PHP is parsed BEFORE any javascript is parsed by the browser, if you need to do this quickly and effectively, AJAX my friend.
  11. jhecht

    Adding dates

    use quotes around this: //var seedDay = new Date(2006,8,23);//This should bevar seedDay = new Date("08/23/2006 00:00:00"); Also you could juse compare the UNIX timestamp from the seeded day and the current day, and then just divide by 100 multiplied by 60*60*24(60 seconds multiplied by 60 minutes in one hour multiplied by 24 hours in one day), which would give you how many days until the next day, or FROM the next day(you may have to doa check if the returned value is negative and accomadate the text for that)If you want i can show you a real quick script for it.
  12. you might either want to use PHP, or AJAX depending on what you are really wanting because as it is, i dont get ur explaination.
  13. Dude do me a favor and put your CSS into one file... i had to spend a few minutes reading through all of your CSS on the page...your Javascript is very complex. at least for a simple AJAX request...Also i think this can be simplifiedif(test!=(-1)) {s = inHl.replace(/\[hide\]/g,"\<div class='hid'\>");s = s.replace(/\[.hide\]/g,"\<\/div\>");}if(test!==-1){s = inHl.replace(/\[hide\].\[\/hide\]/,"<div class=\"hid\">\\1</div>")//Mind you i dont know how javascript does its call back for matching }But yeah... im not sure your Javascript seems overly complex for something so simple...
  14. Check the errors in javascript and then send em here... that should help all of us
  15. Books sucks... I dont read at all other than thing on the computer.
  16. jhecht

    Simple PHP Help

    fread() would work as well....
  17. jhecht

    Printing HTML entities

    Uhm... What exactly would be the point in all fo this because i am so not seeing anything that you would need to do in this...htmlentities, htmlspecialchars, those may be the ones you want to look up on php.net...Other than that, i have no idea what ur talking about.
  18. Yeah but still, using hte right name for a cookie would be a good place to begin .Maybe try calling it with javascript after the PHP script sets it.
  19. Cookies in PHP cannot be defined the first run through because they have to be parsed header information. basically if you have a cookie being set in a page, and in the same page the cookie to be displayed, you need to refresh it and then it should work. <?phpsetcookie("cookieName","My name is Bob the hobo",time()+(60*60));//60 seconds multiplied by 60 minutes?> this is the basic syntax to set up a cookie. What you need to do from here is do a header("location:otherpage.php") and then have it print out cookies there. And its also quite possible that the variable $user is being defined somewhere else....
  20. in order for things to be able to tell the difference between one thing and another, quotes need to be used. you didnt use quotes on your script language="" (even though you should really use <script type="text/vbscript">Thats y
  21. jhecht

    Help me

    <input type="file" name="fileB"/><br/><input type="submit" name="submit" value="upload"/>look up move_uploaded_file on php.net
  22. If you are going to use PHP to submit the form, use PHP to do the sessions as well... there's no point using more than 1 server language.
  23. Ur first issue is that you are using Vbscript ;pyour input type does not have quotes around the values<input type="button" name="Btn1" value="open Excel File"/>always use lowercase things...The link <a href="http://enterpriseportal/"> is not a website, it'll give u an error.and try<script languageE="VBScript">
  24. You should NOT use vbscript. Its pointless and a basic rip off of javascript <script type="text/javascript" language="javascript">//Scripting code goes here for javascript</script><script type="text/vbscript" language="vbscript">VBcode goes here.</script>
×
×
  • Create New...