Jump to content

yoshida

Members
  • Posts

    293
  • Joined

  • Last visited

Everything posted by yoshida

  1. yoshida

    Drop Down Lists

    It definitely would. But it's worlds away from php.
  2. yoshida

    Calender using PHP

    What do you want it to do? The calender is just an interface, and designing the interface is only part of the solution.PHP has an extensive array of calender functions.
  3. yoshida

    Drop Down Lists

    One thing you need to understand is that php is a server side script. It will not do anything unless the user (read: the function a user is using) is making a request.What you can do is have the user select a department, have that saved to a session (or propagate it) when the user hits 'next' and perform a query on the db to select all positions where department = $department. The result will be 'looped' into a new dropdown.A combo of js and iframes is a realistic one too, but you're going to find iframes is a world of hurt on itself.There's more solutions available on the web. They're not easy (and usually require client sided scripting) but they're well worth the effort.
  4. That's some nifty scripting. I might want to hawk that if I may. :)Are you sure the extension of that file is lowercase? Most servers are case sensitive, but I don't know how that works in this situation. You might want to include uppercase exensions in your array, and certain combo's of upper - and lowercase.
  5. that's not too hard; have a user log in on a certain link (that is not seen on te webpage), check the database for the number of rows that contain the combination of username and password (usually 1) and if the login is valid have a session created (if (mysql_num_rows == '1') { $admin = 'valid'; $_SESSION['admin'] = $admin; }You can restrict parts of the script by statingif ($_SESSION['admin'] == 'valid') { display admin menu or function }Each admin script needs to check for the session as well. You can also set a cookie, since sessions usually expire after ten minutes.If you think this is unsafe, make no mistake. PHP is unsafe by definition.
  6. yoshida

    spam

    Thanks for the workaround.But the biggest problem here is spam messages in my guest book.I'm curious how spambots identify a guestbook?
  7. You're me, eight months ago. No better way than trial&error. I'm fairly new at php too (as in 'no guru').Good luck.
  8. You can transfer the data by using a session. Once the handler is done, end the script with session_destroy(); so the variables are unloaded from the server.On sessions: something is saved in a session using $_SESSION['variable']=$variable and loaded from the session using $variable=$_SESSION['variable']; (if you want to know more, look it up)Also, in the 'thank you for submitting' page you can also put this in the head of that page: <meta http-equiv="refresh" content="3; url=http://www.yoursite.org/index.html"> This is a fairly common autoforward command in which 'content' represents the delay time before refreshing to the new page.
  9. You can check the content with the handler, for example:if ($message == "" | $user == "") { echo "sorry, not all required fields are entered. Please try again.<meta http-equiv=\"refresh\" content=\"3; url=form.html\">";}else if (info is double or wrong, I don't know how to check that yet) { echo "sorry, the information you entered is invalid or already in use. Please try again.<meta http-equiv=\"refresh\" content=\"3; url=form.html\">";else { echo "Thank you. You will now be taken to another page.<meta http-equiv=\"refresh\" content=\"3; url=form.html\">"; This is the syntax as I recall it from the top of my head, it may be wrong. Please verify/test and adapt to your needs before using it. You may also wish to save the information already filled to a session, and have it echoed in the fields when the user is taken back (input type=text name=field value=<?$_SESSION['value']?>, again from the top of my head)If you want to check immediately upon leaving each field, that would require Javascript.Meta tags are usually only stored in the head of a document. Only use these tags in documents that you do not wish to validate as (x)html. The meta-refresh is the only way I know to redirect someone to a page and give a proper notification at the same time. But again, I may be wrong.Good luck.
  10. yoshida

    spam

    A while ago I've written my own guestbook (php), and used it for a small number of websites. I decided to create my own to be safe from spam messages. Or at least that's the plan (read: misconception). The guestbook is this one (soon to be replaced by one like this, my latest creation).A week ago I validated the website (the blue/white one) as xhtml 1.0 transitional. It can now be found with Google, but spambots can find it too! Is there any way to avoid these spam messages in the future, without making it harder for regular visitors to leave a message? (I know that's a BIG contradiction, but I hope you get my drift)Handler: //handler;$gnam=$_POST['gnam'];$gmal=$_POST['gmal'];$datum=$_POST['datum'];$gdat=$_POST['gdat'];$page=$_POST['page'];$gcon=addslashes($_POST['gcon']); if ($gnam == "" || $gcon == "") {//checks if a user actually left his name and message after the beep;echo "<div class=\"warning\">Niet alle verplichte velden zijn ingevuld.</div> <meta http-equiv=refresh content=\"1; url=index.php?pageid=gastenboek&command=write\">"; } else { $query="INSERT INTO gastenboek VALUES ('','$gnam','$gmal','$page','$datum','$gdat','$gcon')"; mysql_query($query); echo "<div class=\"warning\">Uw bericht is toegevoegd, dank u wel.</div><meta http-equiv=refresh content=\"1; url=index.php?pageid=gastenboek\">"; } Form: //form;echo "<form action=\"index.php?pageid=gastenboek&command=write\" method=\"post\">";$date=date('ymdHi');$maand_array = array("januari", "februari", "maart", "april","mei", "juni", "juli", "augustus", "september","oktober", "november", "december");$datum = date("j ") . $maand_array[date("n") - 1] . date(" Y");echo "<table><tr><td><b>Naam:</b></td><td><input type=\"text\" name=\"gnam\" size=\"40\"></td></tr>";echo "<tr><td><b>E-mailadres:</b><td><input type=\"text\" name=\"gmal\" size=\"40\"></td></tr>";echo "<tr><td><b>Website:</b> http://</td><td><input type=\"text\" name=\"page\" size=\"40\"></td></tr></table><br />";echo "<b>Datum:</b>$datum<input type=\"hidden\" name=\"gdat\" value=\"'$date'\"><input type=\"hidden\" name=\"datum\" value=\"$datum\">";echo "<br /><textarea rows=\"20\" cols=\"88\" name=\"gcon\"></textarea><br /><input type=\"submit\" name=\"akkoord\" value=\"voeg toe\">"; And yes I know this script is vulnerable for injection attacks, but I'm working on that one (any help is welcome tho).Thanks in advance, and have a great newyear everyone.PS as important: how do I avoid e-mail adresses from getting harvested from my guestbook?
  11. yoshida

    Status

    Do you know php/mysql? I think you're best of searching tutorials (or better yet: books!) about that. Also look into the possibilities of asp(.net) and xml, I'm unfamiliar with both of them but they might be what you need i/s of php.The main page of w3schools offers great intro's to the web languages mentioned above.As soon as you're up-to-speed with what you're intending to do but get stuck, please refer to the appropriate forum.Good luck, and have fun. I'm happy to help out whenever possible.
  12. yoshida

    IE problems

    I just validated your css file, and there seems to be a parse error at line 81.Have a nice x-mass
  13. Hey guys.I've been working really hard to change my site to valid xhtml (transitional 1.0). Some of you might've read about my misfortunes and my inability to cope with it like a pro. The biggest pain was changing links where more than one variable was propagated (a href="index.php?variable1=value1&variable2=value2").The xhtml validator complained about the & causing unexpected results in obscure situations, and recommended changing & to &So I did, using the content manager (stuff like newspages, the menu, the css and the head are stored in a mysql db, so a content manager is a comodity and not a burden). Freaky stuff is, when I adapt the links to valid xhtml and save the page, it seems like it gets rid off the 'amp;' bit. Does the parser remove the ';' character from non-php content? If so, how can I fix this? (addslashes/stripslashes?)Right now I'm too confused about other stuff to do tedious sessions of T&A (that's trial&error you perverted bastards ) so that's why I have to fall back to your experience for my sanity's sake.So yeah, help appreciated. Happy holidays.
  14. Thanks for the trouble.Both solutions have issues tho; the php solution should be before the html tag, which is even a bigger problem than 'should be in the head', and the .htaccess gives no opportunity for a time-out.I've been googling all day, and I'm pretty much about to forfeit my xhtml validation. This thing is forcing my mind into circular logic!EDIT:I'm trying to achieve this./EDITI thank you once again, and like to wish you a happy holidays. Please spend it with your family and not behind a pc.
  15. That would work, except my script has multiple autoforward tags for each submitted form. All form handlers are past the part that generates the <head></head> section. What I need is an alternative, and not a workaround.
  16. My site is bugging me.Right now I'm trying to get it validated, but my script uses a meta to auto-forward to another part of the site. <div class="notify">Action completed. You'll be forwarded within five seconds.</div><meta http-equiv="Refresh" content="4; url=index.php?pageid=home"> This creates the next warning: This is the very last thing I'm unable to tackle (with converting my site to xhtml). Does anyone know how to tackle this? A php solution would be great, if possible no javascript please.
  17. No problem, where's my $100,000?
  18. But it also saves people like you from reading the entire post (and put some thinking into it) before reading the problem has been solved.Sorry pall, can't put it like an edit more than I already did. Happy holidays.
  19. You should format the number stored into your variable.
  20. EDIT: <a href="index.php?pageid=showobj&obj=somepage">click me</a> does the trick. Validation of the homepage is almost complete./EDITHi.I'm currently re-writing my website to comply with w3c xhtml standards. The page is generated by a php script, and the html data is stored in a mysql database. (which makes it possible for me to use a cms, so I can change elements of the site within seconds)I'm not experiencing any problems changing my tags and attributes. It won't even be more than 30 minutes before I changed my css (divs to classes). But changing my script would be harder.The reason I'm posting this in the xhtml forum, is because the validator doesn't like it when I propagate variables. <a href="index.php?pageid=showobj&obj=somepage">click me</a> It produces warnings like Is it possible to change this type of link into valid xhtml without changing my script? Help would be greatly appreciated.
  21. yoshida

    3 divs in one div

    My comment will be hardly constructive, but it will outline what you just experienced: IE doesn't play by the rules. If you write a site that works for IE, chances are your code doesn't comply with W3 standards (and, more important yet, look like crap in other browsers).Firefox and Opera do play by the rules (especially Opera). It's better to design a page for Opera and adapt it to IE (just because it's one of the major browsers your target audience will be using) than the other way around. Else you'll learn how to write 'bad css' for a 'bad browser'.Now for some constructive advise. IE and Firefox handle 'float' differently. Also, if you want to center a div in Firefox, you should add 'margin-left: auto;' and 'margin-right: auto;'. The host div (or body) will have to include 'text-align: center' for IE to comply with your creative thinking.So, in short, the container can be aligned in Mozilla-like browsers by adding 'margin-left: auto;' and 'margin-right: auto;'. See what it does and go from there.Tinker around and have fun.EDIT: some samples
  22. yeah thanks, I guess I'll manage.But can you please be more specific, and use the code I posted? That would help a great deal (as in taking an hour of T&A off my workload).EDIT: I'm giving up on this for now. Reproduction of the code resulted in the menu disappearing behind the main body (and still not on a fixed position).I even added this dope-a$s code: <!--[if lte IE 6]> <style type="text/css"> /*<![CDATA[*/ html {overflow-x:auto; overflow-y:hidden;} /*]]>*/ </style><![endif]--><!--[if lte IE 6]><style> /*<![CDATA[*/ #adsie {position:absolute; top:10px; left:0;} /*]]>*/</style><![endif]--> Let's say a fixed menu is an added plus for firefox users.
  23. Just remembered a fancy word:Google.I'll keep you guys posted.
  24. Hi all.I decided to spend some of my free time re-designing one of my websites. The header is all the way on the left, directly below it (left side of the screen) is a menu bar and directly right from that bar is the main content. The main content and header scroll, the menu bar doesn't. It remains it's position on the screen.This is true for Firefox 2.0.0.1.And not for Internet Explorer 6.0.2900.CSS: #menu {position: fixed;float: left;width: 100px;margin-top: 10;margin-left: 50px;} Is there a way to solve this?While we're at it, when in IE the screen is narrower than the total width of the page, the content container drops below the menu bar. Is there a way to solve that issue too?CSS: #content {width: 702px;text-align: center;margin-left: 210px;margin-right: auto;margin-bottom: 20px;} As you can see the left margin is more than the total width of the menu bar.I can create a sample-page if required, but I'm hoping more experienced css developers may notice flaws that I might've overlooked.Help appreciated (very much).Also: I'd like to wish each and every reader of this post happy hollidays.
  25. Hi. Is there a difference between .net and asp.net? I'm intending to use .net in co-op with sdk and api for Autodesk Revit.The way I see it, sdk is a platform to create .net applications for Revit, and api is a way to deploy the new functionality within Revit. Revit is a high-end architectural CAD-program.If w3 doesn't have the resources I need, can anyone please inform me of some reliable and easy-to-learn resources?Help appreciated.
×
×
  • Create New...