Jump to content

yoshida

Members
  • Posts

    293
  • Joined

  • Last visited

Everything posted by yoshida

  1. Hi. I'm creating a default css page for my new website. Right now it looks like this: body { background: #f9f9ff; text-align: center; border: 0; padding: 0;}#defaultpage { background: #ddddaa; border-style: dotted; border-width: 1; color: #444444; font-family: sans-serif; font-weight: bold; text-align: left; width: 80%; height: auto; margin-left: auto; margin-right: auto; margin-top: auto; margin-bottom: auto;} Pretty self explaining.But how do I make the following happen by default? <a href="somepage.html" style="text-decoration:none" onFocus="if(this.blur)this.blur()"><font color=#222299 onMouseOver="color='#cc7700'" onMouseOut="color='#222299'">somelink</font></a> Some explaining: the default color for all text is dark grey. That's set in the CSS. When I define a link, I'd like it to be blue, bold, with no underline, and change to orange when I hover the mouse over it (still with no line). Once I click it, I don't want a box to appear around it as you would normally have (that's the "if(this.blur)this.blur()" in action). And I want all those things to happen by default once I create a link. It would be no problem for me to define my own new html tag, (something like <link=somepage.html>somelink</link> and define the options for that tag) but I'm pretty new at this.Any help would be great. Happy hollidays.
  2. yoshida

    PHP Editors...

    I use Crimson Editor too. See my avatar for more details.
  3. yoshida

    easyphp help

    OK I think I get it... it runs a preconfigured server that supports PHP.Simply put: a server needs to be up&running in order to respond (and perform it's tasks). Once your pc/server is off, then it's usefullnes for your online website will be down with it.Areeb, I don't intend to be rude, but your spelling needs work. (just imagine people would have the same programming discipline when it comes to spelling...) Web language is OK but an overload will make people overlook your point. Welcome though, I hope you will experience the same deal of inspiration on these forums as I have.
  4. It's a pretty complex matter if you're relatively new.I'm not sure if I'm allowed to link to an offsite tutorial, but this here page will get you started.If you know nothing about PHP yet try this tutorial. These two pages got me halfway to where I am now, in just two or three weeks, and I'm starting to get the hang of it.Make sure your host supports php/mysql.
  5. yoshida

    easyphp help

    I'd say yes, obviously, since if you'd upload a form and have it processed by your PC it has to be realtime. But I haven't tried the program yet.Sounds interesting tho. But frankly, wouldn't it be a security liability?
  6. yoshida

    DISCUSSION

    Hi,I'm figuring out how to link data from multiple tables. This would involve setting a variable, and retrieve data from all tables where the value of that variable is present. This way you can say <? SELECT * FROM database WHERE fieldname='$variable' ?> and make that same query to multiple tables in one script. What's your opinion on how this can be tackled best? Note: since more records in one table can have the same value, the data retrieved this way may not be the data you're looking for.Just a quick mindteaser. Again: I already found a good and reliable way, I'm just curious about your view on this. (file that under 'mutual education')I'll post my code when this post got a view usefull responses, just to prevent biassed replies.
  7. There are variables however that are parsed by the browser, I believe it was 'copy' and one or two other variables. These will obviously not work in a php script, since they're parsed at the client's side. At least, that's what I could make up from one tutorial I was unable to retrieve.
  8. More info here and here.Sorry for double posting, merge my replies if you feel the need to.
  9. Never mind, I found a tutorial on propagating and retrieving variables. Well, actually it is a tutorial on sessions but it also shows how 'tiresome' it would be to propagate everything.
  10. Hi all.I'm creating this database manager, used for adding billing info to a database and asign components to them. It's became quite the dynamic page with frames, forms, loops (also used to create a dropdown box) and nested IF's. Now I'm writing a script to display all that info.So I have tables called bills, components and suppliers. My new page shows all billing info using a loop (even rows in blue, odd colors in yelow) but now I'd like to turn the bill reference number into a link to display all components asigned to that bill.The components table also contains the billing number, along with the component details, so I guess I have to create a hyperlink that contains the variable's value, linking to a script that fetches the info and makes a query to the components table in order to retrieve the component details.So let's see... the query to the billing table is something like this: $query="SELECT * from BILLS"; The billing number is defined as $bnin (internal billing code) and printed using a familiar loop.The new script, which I need to link to, will have to make a query to components: $query="SELECT * from COMPONENTS where BNIN=(output for $bnin)"; Any ideas anyone? This would be a great help.
  11. Look at the current adress bar: index.php?showtopic=3845. So it looks like a database operator from the index.php to (in this case) retrieve data from the topic ID'd 3845.
  12. Above says all.If you're writing PHP but have no idea how it's processed, I'd say you should start using AMP (that's the most common nickname for the holy webtrinity Apache server, MySQL database and PHP). PHP is serversided, Apache parses php info through the php (server side) program and passes the output to your browser (normally in html format).
  13. Like this? $_SESSION['ctyp'] = $ctyp; @dcole: did that, disregarding the config file's warning. Meh, it's just an intranet solution, so who cares.
  14. There's multiple ways for the site admin of getting you that data, one is a query, but a less complex way is to use a database utility such as PHPmyAdmin.
  15. Thanks. That would make things abit easier. I suppose I'd still be able to make fieldnames (and their respective readouts) incremental by adding the suffix $i?PS I finally got sessions to work. Now I'd like to use classes (if that doesn't mean recoding every single page) because that's supposed to be safer. I might be back with some questions about that later.
  16. Forgive my brutality, but why would you want to do that? Can you request the author of that site to make any changes to a page? As far as I know, form data is parsed thru a php script defined on the page (the script runs once you enter the submit button) and that script wil receive and 'handle' the data. I'm not sure but I believe everything happens at server side.For as far as I know, the easiest thing you could do is ask the site admin for an Excel output of the database. This will not happen if the website has a privacy statement.
  17. I get this error when I save a variable to a session, what does it mean and what should I do? I use PHP 4.4.2. Variables are saved to a session using $variable=$_POST['fieldname'];session_register('fieldname'); and read from a session using $variable=$_SESSION['fieldname'] When I refresh the page all is OK and everything works fine, but this is just anoying. Do I use the wrong syntax for this PHP version, or should I adapt a config file for PHP or Apache? Please help me. I try my very best to understand how php programming works.EDIT: got it. session_register is (unsafe) old school. I use the new way right now, which I can't look up at the moment. No errors for now.
  18. Here is a partial script, copied from a tutorial (about login using sessions, Dutch tutorial so no good here) but I think you'll get the idea. $Query = mysql_query("SELECT * FROM users WHERE username = '$login'"); $Results = mysql_num_rows($Query); if ($Results == '1') { Basically what it does is search the database for a username. I think you'll make sure that on a logon system, each username is unique. So this little piece of code checks if a username exists in the database by counting the number of results in the searchquery. You can base your if/else code on that output.Getting the idea will look something like this (this is no actual script, just an explanation what you can do) {$query = mysql_query("SELECT id FROM users WHERE username = '$login'");}ELSE{//add the user to the database in some way.} or something similar to this.Note: I've only been doing this for a month now, but not a week passed without me googling for new pieces of code to adapt for my purposes. (or at least that's what my self-education comes down to.)The complete piece of code (in the Dutch tutorial, but still useful) is right here.Happy coding. :)PS: Fix that. Finding out how to code only gets you halfway. Trial&Error (aka 'debugging') will take care of 'almost' everything else.
  19. I get that as well. Just go to the page, press F5, if that doesn't work press ctrl+F5 (total reload with deletion of the 'old' version) on the start page of your site.Click to wherever you wanna go, if the specific page isn't refreshed then click right mouse button and select refresh for that page. It's a fiddling job every now and then; I got used to making sure the page I watch is the same as the version I saved five seconds ago.Ofcourse it might take a tad longer when you upload to (or download from) a remote server. I'm quite new at this but it's the only thing I can come up with.
  20. I'd recommend Crimson Editor. It would let you save your code in any known format, and color-code it for your convenience (depending on it's file extension). Any other code-enabled text editor should do the trick too. I heard of editors with a debug function but I never got myself to find a proper one for free.
  21. yoshida

    I don't know php

    The way I see it, using a php chatroom would also require MySQL, it would look like a forum except each person's text is chunked as one big heap. And the page would have to refresh every two seconds (requiring you to work with frames if you want to enable the user to type properly).But that's just my guess. JS is a ######, but still one of the best ways to tackle this thing.EDIT: I love the auto-censor thingy on these forums! Wonder what happens if I wrap 'the word' in code tags...
  22. Hi. I'm new here. My name is Bram Weinreder and I work with the IT department of a 'large' architect bureau (large by Dutch standards, we're The Netherland's 4th architect bureau and there are about 200 employees at work in three departments). Right now I'm writing a system database that should be able to function as a CMDB. I never did or saw any PHP coding until roughly three weeks ago.One of the key elements of my CMDB is adding purchase bills through a form, adding components to them and assigning their own unique serial number to them. In order to do so I created a field in the component specification form in which the user should input the number of components that have been purchased.That number (let's say five for this instance) is used by a loop to create fields in the next form (other frame), and assigning incremental fieldnames to them. The fields are auto-called snum1, snum2, snum3 etc. The component specifications and amount are saved in a session.My next challenge is to add the data to a database (dúh) using another loop. It's using the same number (five) in which the component specifications, saved in the session, are added to the database.You might've guessed it: I can't get the loop to read info from the auto generated fieldnames. the value added to the database field snum is defined $snum, so the post data should be readed as $snum=$_POST['snum$i']; (in which $i is incremental using $i++) but that doesn't work.Loop: <?$i=0;while ($i < $numsys) { $i++; $snum=$_POST['snum$i']; $query = "INSERT INTO componenten VALUES ('','$merk','$desc','$snum','','$mnum','$ctyp')"; mysql_query($query);} mysql_close();?> The fields and names are created using the following loop: <?echo "<table>";$i=0;while ($i < $numsys) {$i++;echo "<tr><td>$i<td><input type=text name=snum$i><br>";}echo "</tr></table>";?> I use a table to get the fields aligned when the designated fieldnumber exceeds nine. How do I get a script to read the proper (amount of) values, and add them to a table? Please help me. I'm pretty new at this, and it might give me some new insights to write some other kickass-coding as well. I enjoy doing it, but it frustrates the ###### out of me when things just 'don't work'. I'm using php 4.4.2Thank you very much folks.EDIT: I cracked it!!Now the loop looks like this: <?$i=0;while ($i < $numsys) { $i++; $n="snum$i"; $snum=$_POST[($n)]; $query = "INSERT INTO componenten VALUES ('','$merk','$desc','$snum','','$mnum','$ctyp')"; mysql_query($query);} mysql_close();?> Pretty easy, no?
×
×
  • Create New...