Jump to content

MrAdam

Members
  • Posts

    489
  • Joined

  • Last visited

Everything posted by MrAdam

  1. XAMPP comes with PHPMyAdmin .. i think it's http://localhost/phpmyadmin to access the database - and you use MySQL within PHP scripts .. i think when you connect it's something like: mysql_connect('localhost','root',''); .. unless you specify a password.
  2. ... or you could add ' target="_blank" ' into the link, this makes the link open in a blank window.So you could use: <a href="/images/Camden Center Tuten" target="_blank"><img src="images/Camden Center Tuten.gif" alt="" width="75" height="75" border="0" /></a> if you wanted to add captions/titles, you could create simpler version of the template; one for images. then have the link 'href' set to something like "images/image1.html"
  3. MrAdam

    help!

    you'll probably be wanting them to popup when the page loads, so you'd want to use something like: <script type="text/javascript">onload = function() { var pop1 = window.open('advert1.gif','add1','..features..'); var pop2 = window.open('advert2.gif','add2','..features..');}</script>
  4. MrAdam

    java

    be sure not to mix "JAVA" and "JavaScript" up, as they are two seperate things. JAVA is a programming language used to make applets, and JavaScript is a browser scripting language.
  5. I use XAMPP .. have you got it installed? try "http://localhost/" in a web browser, if you have it installed it comes with a default page, so it should tell you whether or not you have it installed. If you do, to add files/folders; go to "C:\Program Files\XAMPP\htdocs\" or something similar.If not, try downloading it again.
  6. the while loop keeps repeating itself till the program crashes (it's unescapable) .... sorry for double posting by the way .. forum messed up after i clicked "Post"..
  7. I'm trying to create a simple flash slideshow for a website i'm creating. I'm currently creatign a very simple preloader for it.i have a movie clip with the instance name of "loadbar" which I will make bigger to represent how much has been loaded - fairly standard.Here's my script at the moment: setProperty(loadbar,_width,0);b_loaded = getBytesLoaded();b_total = getBytesTotal();l_width = 185;while (b_loaded <= b_total) {p_loaded = b_loaded / b_total * 100;single = p_loaded / 100;new_width = single * l_width;setProperty(loadbar,_width,new_width);b_loaded = getBytesLoaded();}gotoAndPlay(2); But when I "Simulate" the download, it's causing an endless loop and crashing the program.Anybody know why it's not working ??-Thanks
  8. I'm trying to create a simple flash slideshow for a website i'm creating. I'm currently creatign a very simple preloader for it.i have a movie clip with the instance name of "loadbar" which I will make bigger to represent how much has been loaded - fairly standard.Here's my script at the moment: setProperty(loadbar,_width,0);b_loaded = getBytesLoaded();b_total = getBytesTotal();l_width = 185;while (b_loaded <= b_total) {p_loaded = b_loaded / b_total * 100;single = p_loaded / 100;new_width = single * l_width;setProperty(loadbar,_width,new_width);b_loaded = getBytesLoaded();}gotoAndPlay(2); But when I "Simulate" the download, it's causing an endless loop and crashing the program.Anybody know why it's not working ??-Thanks
  9. MrAdam

    Display Database

    certainly... // connect to database ..// submit query ..while($row = mysql_fetch_array($result)) {print '<div id="middle"><div class="post"><div class="postheader"> <h1>' .$row['title']. '</h1></div> <div class="postcontent"><p>Written by <a href="mailto:' .$row['email']. '">' .$row['author']. '</a></p><center><hr width="400"></center><p>' .$row['content']. '</p> </div><div class="postfooter"></div></div>';}
  10. If you are willing to learn AJAX you could do this very easily, without having to refresh the whole page or use frames. You see if you had a main <div>, such as: ...<div id="guestbook">...</div>... with AJAX you could replace the 'innerHTML' with page 2 of the messages.If you want to learn more about AJAX, the w3schools site has a tutorial on it... by they way thibo1025, you don't NEED to use isset(). I use... if ($_GET['page']) ...that method, and it works every time, on all versions of PHP.
  11. You can use AJAX to update the messages, without the standard browser "refresh" look. There are tutorials all over the place for AJAX - it's definately something I would suggest using - a quote from IBM: ----------Really the outline of how it works should be something like this:1: User logs/signs in so they have a screen name - their time of connecting should be saved somewhere (eg. using a session)2: A javascript sends the AJAX request every few seconds (5secs or so)3: The messages sent AFTER the user's saved time, should be pulled out of the database (using PHP+MySQL) and then the list of messages updated.Once you learn AJAX, you will understand how you can do that. Here are a few tutorials on AJAX:http://www.w3schools.com/ajax/default.asphttp://www-128.ibm.com/developerworks/web/...ajaxintro1.htmlhttp://www.ajaxtutorial.net/----------By the way, according to php.net there is no "connect()" function.- Adam
  12. MrAdam

    Display Database

    by the way ... they are called "fields", not "tables".
  13. MrAdam

    PHP Files extensions

    Hmmm, works on my server. Do you have PHP installed ?
  14. MrAdam

    Website icons

    The page needs to be saved in your favourites by the way.From personal use.. I've found them very hit and miss - sometimes they work, sometimes they just don't. It can't hurt to have it there though.I don't think you can just change the filename as well by the way, you need a ".ico file converter" - unless photoshop now supports it or something.
  15. I don't know if ASP/ASP.NET allows this, but i'm pretty sure this isn't possible using PHP. Try posting this in the ASP forum (note: you will need a windows server to support ASP).
  16. in PHP you can define a constant like define("NAME", "MrAdam"); .. then when you access the value of that constant, you use "print NAME". Obviously you can use lower case (for example 'url', 'main').When printing variables or constants within a string (ie. ' print "Hello, ".$name; ') can either concat the strings (like in the example), or, use curly braces.Sooo.. when you see soemthing like.. ... some html ...{body}... more html ... it could be a template (.tpl) file being included into the PHP script, and then the "{main}" being replaced with the value of the "main" constant.----for example:script: define("NEWS", "Adam is immense!");include 'news_template.tpl'; news_template.tpl: <h2>Latest News:</h2><p>{NEWS}</p> .. very basic .. but I think it demonstrates my point well. It would work, but I could be wrong about how you've found it being used. I've never really looked into the phpBB forum scripts much.. but i have seen the "define()" function, ".tpl" files and "{these}" all being used.
  17. var browser = navigator.appName;if (browser == "Netscape") { // netscape} elseif (browser == "Microsoft Internet Explorer") { // ms ie } else { // other}
  18. Helloww!I'm one of those who still uses tables for layout. As everyone does, i want to comform to - what is said to be - the proper way of laying out my websites. Does anybody have a good, useful tutorial for learning how to use DIVs for layout?-Thanks
  19. MrAdam

    Invalid characters

    Also i'm not sure if you can edit the value of a post variable? (I may well be wrong) But I think it's read only...
  20. MrAdam

    been working all day

    thanks for the reply. Unfortunately I couldn't use that method because it would create an insert query for each post variable- also they are grouped (there's 10 inputs for each row) and the amount of groups could be different everytime. However, I didn't know you could name the inputs as an array - thanks for that.I worked out the following soloution: $total = count($HTTP_POST_VARS) - 1;for ($i = 1; $i <= $total; $i++) { $item = 'item'.$i; $id = $_POST[$item]['0']; $title = $_POST[$item]['1']; $class = $_POST[$item]['2']; $model = $_POST[$item]['3']; $extras = $_POST[$item]['4']; $manfac = $_POST[$item]['5']; $pound = $_POST[$item]['6']; $pence = $_POST[$item]['7']; $price = $pound.'.'.$pence; $color = $_POST[$item]['8']; $scale = $_POST[$item]['9']; $stock = $_POST[$item]['10']; if (strlen($id) > 0) { $query = mysql_query("INSERT INTO minimerc_product (id,title,class,extras,model,manufacturer,price,color,scale,stock) VALUES ('{$id}','{$title}','{$class}','{$extras}','{$model}','{$manfac}','{$price}','{$color}','{$scale}','{$stock}')"); - which works perfect. thanks for the help.
  21. hi guys!kinda hard to explain, but basically i've created a form. The form is to insert data into a database. To make it more efficient, I made it so you can click a button to add - what would effectively be - an extra row. This button isn't limited so you can add as many as you'd like. To recognise one row from another though, i named the fields like so:row 1:id_1 , title_1 , description_1row 2:id_2 , title_2 , description_2Hopefully you follow me. Now I'm trying to process these inputs; with little luck. Can anybody think of a soloution that will allow me to end up with each row in it's own sql insert statment: INSERT INTO tbl (id,title,description) VALUES ('{$id}','{$title}','{$description}'); or something similar.-Much Thanks
  22. or, (as i prefer) you can install an Apache server, PHP and mysql and run it off your computer. you said you'd downlaoded them but couldn't get them to work - it's so hard, I couldn't get it working myself. I used "xampp" (google it) .. installs them all at once and makes it real simple.
  23. hmm, must differ between the browsers then - it seems to open in a new tab with firefox...
  24. MrAdam

    Icon

    how do you do them?- draw the sketch then colour them in using photoshop (or something) ?
×
×
  • Create New...