Jump to content

yoshida

Members
  • Posts

    293
  • Joined

  • Last visited

Everything posted by yoshida

  1. yoshida

    smileys

    Smells great. ^^Thanks. I should learn to find my own way in this... then again: what good would a forum be?
  2. yoshida

    smileys

    I'll try that, thanks.Any good pages on arrays in general?
  3. yoshida

    smileys

    Hi.How do I make an array to replace specific text with an image? I'm writing a guestbook and would like it to contain smileys.Thanks in advance.EDIT:Here's the guestbook, a onepage script. if ($pageid == 'gastenboek') { if ($mode == 'write') { if (isset($_POST['akkoord'])) { $gnam=$_POST['gnam']; $gmal=$_POST['gmal']; $gdat=$_POST['date']; $gcon=$_POST['gcon']; if ($gnam == "" || $gmal == "" || $gcon == "") { echo "Niet alle verplichte velden zijn ingevuld. <a href=index.php?pageid=write>opnieuw</a>"; } else { mysql_connect('localhost',$user,$pass); mysql_select_db($dbas) or die( "Unable to select database"); $query="INSERT INTO gastenboek VALUES ('','gnam','gmal','gdat','gcon'"; mysql_query($query); echo "Uw bericht is toegevoegd, dank u wel."; mysql_close(); } } else { echo "<form action=index.php?pageid=gastenboek 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><b>E-mailadres</b></tr><tr><td><input type=text name=gnam size=30><td> <input type=text name=gmal size=40></tr></tr><table><br><b>Datum:</b>$datum<input type=hidden name=gdat value=$date>"; echo "<br><textarea rows=20 cols=70 name=gcon></textarea><br><input type=submit name=akkoord value='voeg toe'>"; } } else { mysql_connect('localhost',$user,$pass); mysql_select_db($dbas) or die( "kan database niet vinden."); $query="SELECT * from GASTENBOEK ORDER BY date ASC"; $result=mysql_query($query); $num=mysql_num_rows($result); $i=1; while($i < $num) { $name=mysql_result($result,$i,"gnam"); $mail=mysql_result($result,$i,"gmal"); $date=mysql_result($result,$i,"gdat"); $gcon=mysql_result($result,$i,"naam"); $i++; echo ""; } }} This is a prove of concept, as well as aditional info to tell me what to implement and how and where. You're free to use this concept.When you click the link to the guestbook, it will propagate that 'pageid=gastenboek'. It'll check if 'mode' is set to 'write' (a link on the guestbook itself) and if so, if the 'submit' button has been hit. If not, the script will generate a form and the submit button. When you hit submit the form will be posted into the database, giving it the date and timestamp (as for right now) 0606291402 (ymdHi) to sort each post by year, month, day, hour and minute.Let's assume you're reading, and never hit the 'write' link. Everything that all other folks have written will be echoed, sorted by time and date. I haven't written that function yet, as the stylesheet isn't done. I'll get to it later.Anyhow, I'm implementing this beauty in my eggshell site builder (along with several newspages and a content manager). I'll be able to show the script and a working version 'pretty soon' since it'll become the backbone for my site.
  4. yoshida

    login script

    Thank you very much.It's 'just' going to lock the content manager for my website, used by a few moderators. So if no one sees there is one, no one is trying to use it without logging in (at least that's my guess).
  5. yoshida

    login script

    Hey.I've been building this login script (adapted one from a tutorial to get it all in one file), here it is. if (isset($_POST['akkoord'])) { $logn=$_POST['logn']; $logp=$_POST['logp']; mysql_connect('localhost',$user,$password); mysql_select_db($database) or die( "Unable to select database"); $query = "SELECT * FROM users WHERE unam = '$logn' AND pwrd = '$logp'"; $result=mysql_query($query); $num=mysql_num_rows($result); mysql_close(); if ($num == '1') { $logid = '1'; $_SESSION['logid']=$logid; echo "You are logged on. <a href=index.php>HOME</a>"; } else { echo "Sorry, you're not logged on. Please try again.."; } } else { echo "<form action=login.php method=post>"; echo "<b>Gebruikersnaam<br><input type=password name=logn><br>Wachtwoord</b><br><input type=text name=logp><br>"; echo "<input type=submit name=akkoord value=akkoord>"; } What this does, basically, is check wether you clicked 'submit' (akkoord). If you didn't do it yet, it'll show you a form where you can enter your username and password. When you click submit the script will reload and check the database for a user with that password. When that's the case (mysql_num_rows=$result, $result being 1) a value will be loaded into a session.This is all incredibly unsafe ofcourse. People can hack it by just reading the script and 'manufacture' a login.Does anyone know a safer way? Any recommendations?(can't wait to show you guys my eggshell script, and a working example...
  6. yoshida

    pictures

    Thanks, I'll look into that.
  7. yoshida

    pictures

    How to do it. I can see logically what should happen, but I don't know how to make it work.For instance: what command makes a php script scan for pictures on a specific location? And with what command can I get them to show on a page? I simply want to know if it can be done, and if yes how.
  8. yoshida

    pictures

    Heya.Is there a way to make php generate a page with pictures? Let's say you echo an article named 20060626 (date formatted as yyyy/mm/dd so all articles can be sorted by date no mather what). There's also a folder on the same server named 20060626, which contains pictures. Is it possible for a php script to generate a 'photo album' once it knows where the pictures can be found?First of all, the script should know where those pictures are. Not too difficult, since the folder has the same name as the article id. Then the script needs to check if there's actually jpeg files in that folder, how many there are and how they're called. At least that's what I'm thinking.Any ideas? I wouldn't mind using js, tho I'd like to avoid using too much of it.
  9. yoshida

    js and php?

    Stripslashes works! :)Thank you very much <?$pageid=$_GET['pageid'];if ($pageid == insert) { if (isset($_POST['voegtoe'])) { $name=$_POST['name']; $inhoud=$_POST['inhoud']; echo stripslashes($inhoud); } else { echo "<form action=index.php?pageid=insert method=post>"; echo "<b>Naam</b><br><input type=text name=name><br><b>Inhoud</b><br><textarea name=inhoud cols=150 rows=20 WRAP=OFF></textarea>"; echo "<br><br><input type=submit name=voegtoe value=OK>"; }}?> The start of a very dynamic one-script website... kudos to Skym for making this rule so much
  10. yoshida

    js and php?

    Yo.I'm trying to make a php script echo html code containing a javascript.The html code looks like this: <html><head><link rel=stylesheet type="text/css" href=apb.css></head><body><div id=menu> <div id=r1></div><div id=r2></div><div id=r3></div><div id=r4></div><div id=r5></div><div id=r6></div> <div id=inhoud> <table cellspacing=5 cellpadding=0 align=center> <tr><td><img src=apblogo.png></tr> <tr><td><a href=nieuws.html target=main onFocus="if(this.blur)this.blur()" onmouseover="document.images['nie'].src='nieover.gif'" onmouseout="document.images['nie'].src='nieout.gif'"><img src=nieout.gif border=none name=nie></a></tr> <tr><td><a href=http://apb.write2me.nl/ target=main onFocus="if(this.blur)this.blur()" onmouseover="document.images['gas'].src='gasover.gif'" onmouseout="document.images['gas'].src='gasout.gif'"><img src=gasout.gif border=none name=gas></a></tr> <tr><td><a href=engeland.html target=main onFocus="if(this.blur)this.blur()" onmouseover="document.images['eng'].src='engover.gif'" onmouseout="document.images['eng'].src='engout.gif'"><img src=engout.gif border=none name=eng></a></tr> </table> </div> <div id=r6></div><div id=r5></div><div id=r4></div><div id=r3></div><div id=r2></div><div id=r1></div></div></body></html> Here's the php script. It's supposed to first echo a form in which I insert the html code, and after you click 'submit' echo the html code. I'll make it add the code to a database later. <html><head><link rel=stylesheet type=\"text/css\" href=apb.css></head><body><div id=menu> <div id=r1></div><div id=r2></div><div id=r3></div><div id=r4></div><div id=r5></div><div id=r6></div> <div id=inhoud> <table cellspacing=5 cellpadding=0 align=center> <tr><td><img src=apblogo.png></tr> <tr><td><a href=nieuws.html target=main onFocus=\"if(this.blur)this.blur()\" onmouseover=\"document.images[\'nie\'].src=\'nieover.gif\'\" onmouseout=\"document.images[\'nie\'].src=\'nieout.gif\'\"><img src=nieout.gif border=none name=nie></a></tr> <tr><td><a href=http://apb.write2me.nl/ target=main onFocus=\"if(this.blur)this.blur()\" onmouseover=\"document.images[\'gas\'].src=\'gasover.gif\'\" onmouseout=\"document.images[\'gas\'].src=\'gasout.gif\'\"><img src=gasout.gif border=none name=gas></a></tr> <tr><td><a href=engeland.html target=main onFocus=\"if(this.blur)this.blur()\" onmouseover=\"document.images[\'eng\'].src=\'engover.gif\'\" onmouseout=\"document.images[\'eng\'].src=\'engout.gif\'\"><img src=engout.gif border=none name=eng></a></tr> </table> </div> <div id=r6></div><div id=r5></div><div id=r4></div><div id=r3></div><div id=r2></div><div id=r1></div></div></body></html> [updated]The javascript seems to need those quotation marks, yet the php script needs to ignore them. Is there an easy sollution for this? Help appreciated.[/updated]
  11. What you're saying is that you can build an entire program within one file? That's just going to be too complicated right now, and I don't want that to limit my ambitions.I'll stick with the separate html forms and the central php file. Thanks for the info anyways - seems like I'll want to learn Perl after all. ^^
  12. Yeah, that's what I thought. I already had to use it once because each form can only perform one script.Is there a limit to how many actions you can put in one script? If not I'm intending to go with unique form files and one database processing file. (one backbone script...oooh happy happy debugging ^^)Anyway, the real question is would you recommend it (and why[not])?
  13. Hi.Would it be convenient to have one script that contains all button actions? I know it's possible for a form to have multiple buttons, and for a script to check what button you pressed (and execute the required action) using the if (ISSET...) etc operators. So, the same way as you would make one central css file, would it be convenient to create one central php file for all button actions too? (that would save me lots of 'did I already finish that script', 'what's the frigger called' etc) One would say that thing would be some kind of kernel for web- and intranet based (SQL)applications.
  14. HTML: structure.CSS: formatting.JS: browser scripting.But where does the content go? Should that be loaded externally through something like AJAX? Ow wait... that's going to be deprecated to since I've only seen it coded in the <head> section.Something tells me everything but databases and serversided scripting will be dead five years from now. Welcome to the AMP era. ^^
  15. That's not 'agressive moderating', that's a job well done. I've known some bad moderators who switched 'mod' with 'god', none of them are here. I also said it shouldn't be present, but unfortunately it is on other forums.I fully second Dan's suggestion to give you a medal.
  16. Agressive moderating or moderator picking shouldn't be present on this forum IMO, since we're all the same to some extend: a happy bunch of smart geeks who like to share knowledge.Still... the moderators in this topic who state that they shouldn't need to be distinguished have the word 'moderator' in their signature. You can see who's a moderator in multiple ways so you'll only want more clues if you're up to something. And I hope that remains a no-no. I've been on a number of forums (mostly webcomic related) and this one is in my top ten of most enjoyable forums.
  17. yoshida

    Rounded corners...

    Try 778bb0, that's the mathematical inbetween.If you're not entirely hapy with that keep punching color codes untill you are.
  18. OK I can see why people want one standard... so you don't have to be creative anymore and everyone will make the same kind of pages.
  19. yoshida

    Rounded corners...

    It looks great now, except the divs with the links and the main content look much higher in Firefox than in IE.You still might want to add an anti-aliasing by adding a border left and right of each corner element, and give it a bluewhite-ish color. IMO the sharp contrast between the border and the background color distract attention from the content.I still love what you did and how you did it. Nice job.
  20. Yeah, but how about IE 7.21 or Firefox 1.8 when those versions are going to go 'live'? I agree browsers should primarily support webprogrammer's best practices and an 'easy way out' for the regular n00b for it all to make sense, but I believe the gap between the technology and the user will be a serious infringement on freedom of netspeech.Yet again, the web is too crowded to contain a bilion crappy sites. Isn't it?
  21. Awesome, thanks. I'll also try to save some space with other divs that way.Someone else told me you could even say <div class=r1 r2 r3 r4 r5 r6></div> but wouldn't they end up nested that way?Thanks again.
  22. Sounds nice. I'll give it a spin and will let you know if it works for me.
  23. I did think about that, but I didn't know how to do it and didn't really have the time to learn it.It looks neat. But can I have control of it's width? Does the length automatically adjust to the content, without any glitches at all? I will try to find the time to investigate. It looks like one step beyond a 'scripted iframe'. At best I'll use it to display the header and menu bar, and maybe the main content, but wouldn't that be just like the way I'm using frames right now?Again, I'm going to investigate this, and will use it if this makes things beter and/or easier.
  24. Why do you think it's called CASCADING style sheets? The way I understand it, inline styles have priority over an onpage-stylesheet (<head><style etc>stylesheet goes here</style></head><body>), which has priority over an external stylesheet. Thus cascading the priority of the sheet.So if the inline style attribute has top priority, why abandon that concept?Just my $0.02 anyway...
  25. yoshida

    Rounded corners...

    The rounded corners get twice as high in IE as in FF if you don't add overflow:hidden; (at least where I live they do).Anyways, the site design is neat and I think those corners really add something to the look and feel of your page.
×
×
  • Create New...