Jump to content

MrAdam

Members
  • Posts

    489
  • Joined

  • Last visited

Posts posted by MrAdam

  1. ... 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"

  2. 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>

  3. 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.

  4. 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.

  5. 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

  6. 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

  7. 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>';}

  8. 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.

  9. 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:

    Five years ago, if you didn't know XML, you were the ugly duckling whom nobody talked to. Eighteen months ago, Ruby came into the limelight and programmers who didn't know what was going on with Ruby weren't welcome at the water cooler. Today, if you want to get into the latest technology rage, Ajax is where it's at.
    ----------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
  10. 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.

  11. 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).

  12. 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.

  13. 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

  14. 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.

  15. 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

  16. 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.

×
×
  • Create New...