Jump to content

Lee

Members
  • Posts

    75
  • Joined

  • Last visited

    Never

Everything posted by Lee

  1. Hi, Does anyone know where I can find a really simple banner rotation script, hopefully an os/free script? The banners are links to charity sites, there is no need to count statistics or give them a login e.t.c. I just need a simple script that can rotate about 4 banners & nothing else. I need to be able to put the code in 4 static php pages, & one in overall_header.tpl of a phpbb board. Any advice appreciated :)
  2. ..er ok now its working.. I must have gremlins somewhere. Thanks for the help anyway :)
  3. Yeh, I copied & pasted it. I put the require command right after [code]<html xmlns="http://www.w3.org/1999/xhtml">[/code] maybe thats in the wrong place?
  4. Hi, I just want to make a simple constant for a copyright that I put at the bottom of each page. I made a page called cosnstants.php & put the following code.. [code]<?php define (COPYRIGHT,'<span class="maintext">&copy; Stone Island Records 2006</span>'); ?>[/code] then in the index page at the top I put [code]<?php require_once("constants.php"); ?>[/code] and then at the bottom of the page [code]<?php echo COPYRIGHT ?>[/code] how have I ballsed this up? :-[ Thanks.
  5. Its a unix server, and I am trying to use sendmail. Its definately not a code problem because it works fine on another server, and also, I have a CH-phpBB board which is also not sending mail. [code] //sending sign-up e-mail (validation notice) $val_key=$email.time(); $val_key=md5($val_key); $sql_query="insert into validate (email,password,val_key) values ('$email','$password','$val_key')"; sql_execute($sql_query,''); $data="<a href='$main_url/index.php?mode=join&act=val&val_key=$val_key&inv_id=$inv_id'>Verify Email</a>"; messages($email,'0',$data); [/code] Thanks :)
  6. Hi, I hope you don't mind me asking here. Can anyone give me an idea why my server won't send emails through php? I have set php.ini like this & re-booted.. [code] [mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 ; For Win32 only. sendmail_from = lee@mydomain.com ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). sendmail_path = /usr/sbin/sendmail -t -i[/code] Is there anything else I could try to get it to work? Thanks.
  7. Lee

    Tag order

    That was very helpful, thanks :)
  8. Lee

    Tag order

    Makes perfect sense. Thanks, appreciate it  ;D
  9. Lee

    Tag order

    Ah, I see. Thanks for that  ;D So always single quotes for html output?
  10. Lee

    Tag order

    I'm learning from a video, and noticed an opening & closing tag where I wouldn'e expect it (see below). [code]   <?php   $Apples = 10;   $Oranges = 20;   $Bananas = 5;     if ($apples != 8)     echo "<center>Apples are more than 8</center> <p>"   ?>     <?php [/code] This works fine.. but when outputing a table.. [code]   <?php     if ($Oranges >= 10 && $Bananas == 5) { ?>           <table align="center" width="450" border="0" cellspacing="0" cellpadding="0">   <tr>     <td align="center" valign="middle" bgcolor="#D6DCEB">Those conditions were true </td>   </tr>   <tr>     <td align="center" valign="middle" bgcolor="#F3F7FC">This table appears </td>   </tr> </table>         <?php } ?> [/code] It works perfectly, but why does there need to be a closing php tag after the opening curley brace, and an opening php tag before the closing curley brace in order for this to work? The guy narrating the vid didn't explain this, I just noticed it on his page.
  11. I have an idea that you're going to be up all night  :-[
  12. Lee

    SOLVED

    Is there a tutorial here on how to set up a MySQL database on a local machine in WAMP5? I had a look, but if its under my nose, I always miss it :-[ Thanks.                   [color=green] I just discovered to do it in phpMyAdmin.  :)[/color]
  13. Lee

    Constants

    Ok I'm into another pickle. This code.. [code]<?php /* this is a script using a simple constant to make a calculation*/ define("TRADE_DISCOUNT", 0.75); $Amount= 20.00; $Discount= 2.50; $Trade= $Amount * TRADE_DISCOUNT; echo "A cheap guitar costs {$Amount}. You can get a discount of {$Discount}.<br />     When you buy at trade price though, you get it at {$Trade}. <p>"; echo "We can buy it for £",TRADE_DISCOUNT; ?> <?php /* this is the line & file constants (line tells you hat line it is on, File tells you the path to the file*/ echo __LINE__; echo __FILE__; ?>[/code] ..produces this in the browser [quote]A cheap guitar costs 20. You can get a discount of 2.5. When you buy at trade price though, you get it at 15. We can buy it for £0.75 20 [/quote]
  14. Lee

    Constants

    aaaahh, a rookie mistake. (I just started last night). Thanks guys!  ;D
  15. Lee

    Constants

    i am learning from a book, & it has not illustrated how constants should be written. I wrote this code.. [code]<html> <head><title>Constants</title></head> <body> <?php /* this is a script using a simple constant to make a calculation*/ define("TRADE_DISCOUNT", 0.75); $Amount= 20.00; $Discount= 2.50; $Trade= $Amount * TRADE_DISCOUNT; echo "A cheap guitar costs {$Amount}. You can get a discount of {$Discount}.<br />     When you buy at trade price though, you get it at {$Trade}. ?> </body> </html>[/code] But I get this error.. [quote] Parse error: parse error, unexpected $end in C:\wamp\www\constants.php on line 15[/quote] I don't understand about line 15, thats just the closing html tag, but obviously I'm doing something wrong. Can anyone enlighten me please? Thanks  :)
  16. [quote author=wildteen88 link=topic=108798.msg438059#msg438059 date=1158766677] Yeah that is correct. PHP runs on the server, thus you had to instal WAMP. You cannot run php files like you can when you double click a html files and it opens up in IE. PHP is not a lanaguage the browser understands, as PHP is a web programming langauge. HTML, CSS and javascript are client side lanagugaes which the browser understands. PHP generates the output which will be mainly text/HTML from your code. [/quote] Aha, thats another penny that has now just dropped! Thanks again  ;D
  17. aahh I see, I was just going to the www directory & opening the file. I didn't realise I would need to use http://localhost/ in the browser. I assume I will do this with every file I create now then.. Thanks mate!! ;D
  18. Hi everyone I'm also brand new to php  :-\ I have just installed WAMP5, used localhost during install, & localhost is showing all the right info. I'm learning from the 'php for dummies' book & made a php file with the following code.. [code]<html> <head> <title>PHP Test</title> </head> <body> <p>This is an HTML line <?php echo “<p>This is a PHP line</p>”; phpinfo(); ?> </body> </html>[/code] I know this is info is already available from localhost, but where would I store this file to make it work? Thanks.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.