Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Posts posted by wildteen88

  1. I think you may have missed a step. if you look in admin/config.php file you should of noticed this line:
    [code]$database_exists = 0;            // Set to 1, before installing, if database exists[/code] if you change 0 to 1 and save the config.php file you should be able to install whatever you're installing.
  2. With CSS there three selectors class (.), id (#) and html tag name (body, html etc)

    Now what moberemk meant was to give your anchor tag the id of elementname like so:
    [code]<a href="home.html" id="navlink">Home</a>[/code]
    Now to style any anchor tag with the id of [b]navlink[/b] you use the following CSS:
    [code]#navlink a:link, #navlink a:active, #navlink a:visited {
        color: #FF0000;
    }
    #navlink a:hover {
        color: #00FF00;
    }
    [/code]
    Say that you want another link but want it different you'll just change the id value to different one such as "bodylink":
    [code]<a href="home.html" id="bodylink">Home</a>[/code]Then with your css you'll do this:
    [code]#navlink a:link, #navlink a:active, #navlink a:visited {
        color: #FF0000;
    }
    #navlink a:hover {
        color: #00FF00;
    }

    #bodylink a:link, #bodylink a:active, #bodylink a:visited {
        color: #0000FF;
    }
    #bodylink a:hover {
        color: #FF0000;
    }
    [/code]

    Have a read on CSS syntax over at [a href=\"http://www.w3schools.com/css/css_syntax.asp\" target=\"_blank\"]w3schools.com[/a] for a better understanding of CSS selectors.
  3. Dont worry about your status we wont treat anyone different if your status is set to Guru. The staus is about your post count. This is a forum feature you wont be able to change your status as it set by the admin and I think anone with 100+ posts is set the status of guru, this is an automatic procedure.

    No moderators or admins set your status manually, its all done by the forum itself.

  4. MySQLi's functions in PHP is different to the normal mysql extensions. As people that do alot of OOP (object oriented programming) can use the inbuilt mysql class with the mysqli extension to connect to the mysql database.

    Also alot of the mysqli_x functions have slightly different syntax compared to normal mysql_x functions. Such as the parameters are in different locations or some have more parameters too.

    Generaly mysqli is alot more better than the original mysql extension.
  5. I would recommend you to put back ticks around the word Password in your mysql query as password a predefined function in mysql and so m ysql is getting confused so if you add back ticks around it then your query should pass through:
    [!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][color=green]WHERE[/color] Username[color=orange]=[/color][color=red]'$username'[/color] [color=blue]AND[/color] `Password`[color=orange]=[/color][color=red]'$password'[/color]" [!--sql2--][/div][!--sql3--]
  6. GD2 is already compiled with PHP on WIndows. In order to use GD you will need to enable the php_gd2.dll file and you'll be able to use the various GD2 functions.

    Just open up you php.ini file and setup the line that says extension_dir so it points to the PHP extension folder.

    Then scroll alittle further and you'll need to remove the ; from the start of the line that says:
    ;exension=php_gd2.dll

    Once you have done that save the PHP.ini file and restart your server for the changes to be made.
  7. Notices are not errors. Errors stop your script from running how notices allow your script to continue. PHP notices are just telling you that something isn't correct however PHP was smart enaough to correct the issue as it assumed you meant 'var' instead of var.

    $_GET[var]

    PHP thinks you're are using a constant called var and not the index or key called var. This is why you should use quotes when you are using keys in an arrray or defining a variabled etc.

    So if you use:
    define('MSG_ADD','Record Added Successfully.');

    You shouldn't get any notice messages by doing the above.
  8. You can use any extension you like but allweasy save your files that get included with .php extensions otherise any other file such as .html, .txt, .inc will treat your PHP code as normal text and so a user can see your PHP Code! However you can use any extension you like for your files that get included as PHP will parse these as PHP with the parent script when they get included, just make sure you surrond your code blocks in PHP tags.

    One tip I would recommend you to do is prehaps save your files as filename.inc.php so you can easily identify your files that get included from the normal .php files.
  9. You'll want to create two tables called products and cateogries. In the products table you store all your products that you have when you create your table make sure you create an extra row cam call that catid as this will be used for getting the correct products for each category. SO you products table will loook like this:

    Products
    |
    +- pid
    +- name
    +-description
    +- price

    ... more rows here ...

    +- catid

    Now you categories table will look like this:
    Cateories
    |
    +- cid
    +- name
    +- description

    Now when you do your MySQL Query you'll want to do it like so:
    SELECT * FROM products WHERE catid = $_GET['cid']

    $_GET['cid'] is passed over the url like so: products.php?cid=1

    Then the sql will be ran and will get all the products with the catid of 1.
  10. Post your error messages here along with your code then we'll be able to help you a lot more. Basically fi you want to see if certain field is emtpy the use this:
    [code]if(!isset($_POST['FieldName']) || empty($_POST['fileName']))
    {
        echo "PLease fill in all fields thank you!;
    }[/code]
  11. You cant with javascript however you can with PHP using this:

    $_FILES['fileUploadFormNameHere'][size']

    change fileUploadFormNameHere to the name you have named your upload form to. The above code returns the size of the file in bytes. To get the size in Megabytes you'll want to divide the size by 1024.

    Have a read through [a href=\"http://uk2.php.net/manual/en/features.file-upload.php\" target=\"_blank\"]here[/a] on how to use the $_FILES superglobal array.

    So to check the file size of an uploaded file you'll want to do this:
    [code]$size = $_FILES['fileUploadFormNameHere'][size'];

    if($size > 2097152)
    {
        die('File size must not be over 2MB! Your file was ' . number_format(($size/1024/1024), 2) . 'MB');
    }[/code]
  12. I dont think there is a way of calculating a users DST with PHP as PHP cant communicate with the client computer you will have to provide a pull down menu that has all the DST's. You can see a full DST pulldown menu if you go to My Controls and select Board Settings.

    There should be a pull down menu which will show all DSTs!
  13. if its a warning then apprentice webmaster's script wont run at all!

    apprentice webmaster the error message is saying you have somethikng being outputted to the browser near/on line 45 in clsMetaContent.php

    What is around line 45 in clsMetaContent.php. Could you post lines 40 - 50.
  14. Make sure PHP is using the correct php.ini file by checking this with the phpinfo() function. Where is the php.ini file you are editing?

    If php is using the wrong file then ad this directive to to your httpd.conf file:
    [code]#PHPIniDir
    PHPIniDir "C:/WINDOWS"[/code]change C:/WINDOWS to where you are editing the php.ini file to. dont add php.ini to the end just do it to the folder it is been stored in.

    Also make sure you are restart Apache.
  15. This is the code you'll want for your category menu:
    [code]echo "<form name=\"cat\" action=\"category.php\" method=\"get\">";
    echo "<select name=\"cat\" onChange=\"document.cat.submit()\">\n";
    echo "<option>Choose a category:</option>\n";
    echo "<option  value=\"phones\">Phones</option>\n";
    echo "<option value=\"accessories\">Accessories</option>\n";
    echo "<option value=\"cards\">Cards</option>\n";
    echo "</select>";
    echo "</form>"[/code]
    Now when the user selects a category they will be sent to category.php. Now to retieve the sent data you'll want to use this code:
    [code]<?php

    // make sure you connect to your database in order your query below to work

    //check that $_GET['cat'] is actually set
    $cat = isset($_GET['cat']) ? $_GET['cat'] : '';

    $cats = array('phones', 'accessories', 'cards');

    //if $cat is empty or if the value of $cat is not in the $cats array stop the script from running as the
    // user hasn't made a valid selection and could be trying to hack your site! This is a good technique
    // to use as it limits what a user can submit!
    if(empty($cat) || !in_array($cat, $cats)) {
        die("<b>WARNING</b><br />No selection/an invalid selection was made. Please submit a valid value.");
    }

    //query time
    $query = "SELECT * FROM ad WHERE category = $cat";

    ?>[/code]And there you have it. You just needed a line of javascript which was this:
    [i]document.cat.submit();[/i] to submit the form with the onChange event! Then if you read the comments (//) in the secound code block you should see how it's done.
  16. I would recommend you to learn just the basics such as INSERT, EDIT and DELETE queries of MySQL as it'll be alot more easier to use a database rather than a flat file database. As with a database you can easily get the infomation you want where as a flat file you will have open it read it the put all the comments into an array sort it then select the correct comment for x picture. A database can do all this with just one query.

    A database is a hell of alot better.

    If you want to learn how to use MySQL and PHP then follow through the tutorials [a href=\"http://www.php-mysql-tutorial.com/mysql-tutorial/index.php\" target=\"_blank\"]here[/a] - that is just using MYSQL in a DOS window just to get to grips with mYSQL. Then you'll want to go through tutorial numbers 4 - 7 [a href=\"http://www.php-mysql-tutorial.com/\" target=\"_blank\"]here[/a].

    Also in order for you to do a comment system I would recommend you to learn how to create a basic guestbook as you can adapt a basic guestbook into a your comment system very easily becuause a questbook is a comment system. [a href=\"http://www.php-mysql-tutorial.com/mysql-php-guestbook.php\" target=\"_blank\"]Part 1[/a] and [a href=\"http://www.php-mysql-tutorial.com/mysql-php-guestbook-2.php\" target=\"_blank\"]Part 2[/a].

    I know it sounds a lot but learning the basics of MySQL will only take a few hours max. Then a couple more hours to get the basics of PHP and MySQL. Once you've go those under your belt you should be able to be set to create your comment system. Again the guestbook tutorial will tak about 1 - 2 hours if you do that then you'll be able to create your comment system.
  17. I would of coded your script the opposite way around like so:
    [code]<?php
    if(isset($_POST['submitf'])) {
        // accept input for user name – in the format of email
        $uname=$_POST["em"];
        // determine redirection destination depending on email input by user
        if ($uname=="123@123.com") $newloc="abc.php"; else $newloc="123.php";
        // redirect to new location
        header("location: $newloc");
    }
    ?>
    <form name="form1" method="post" action="">
    <p>login (email):
    <input type="text" name="em">
    <input name="pass1" type="password">
    <input name="submitf" type="submit">
    <input name="resetf" type="reset">
    </p>
    </form>[/code]
  18. Your layout is clear and consitent however the there areas which let your layout down which is the use of standard fonts, which is not good as they dont match in with your site! I would recommend you to use the font you use in your horizontal menu, which I think is Century Gothic.

    With these little changes it'll make your site a lot more better!

    I would recommend you to get ride of the Javascript menu and replace it with a CSS one, as you can do that same menu in CSS with far less code! And it should cross browser compatible in all CSS enabled browsers.

    Have a look at [a href=\"http://css.maxdesign.com.au/listamatic/\" target=\"_blank\"]here[/a] and [a href=\"http://css.maxdesign.com.au/listamatic2/\" target=\"_blank\"]here[/a] for all the various CSS menus you can do with CSS. ALso you can learn how to create a CSS menu [a href=\"http://css.maxdesign.com.au/listutorial/\" target=\"_blank\"]here[/a].

    [b]EDIT:[/b] If you have a look [a href=\"http://homepage.ntlworld.com/cshepwood/BranchingOutDesigns/\" target=\"_blank\"]here[/a] you'll see your design with a 100% CSS Layout as well as the CSS menu I was on about. Also have a look at the source code of the redesign you'll noice there is hardly any coding just bare HTML! This is how great CSS is! You can see the CSS used [a href=\"http://homepage.ntlworld.com/cshepwood/BranchingOutDesigns/style.css\" target=\"_blank\"]here[/a].
  19. You'll want to code your if statement like so:
    [code]if(is_null($first) || is_null($last) || is_null($gun) || is_null($age) || is_null($saying) || is_null($email) || is_null($phone) || is_null($users) || is_null($pass))
    {
        echo "Please fill in all fields!";
    }
    else
    {
        //process form data
    }[/code]
  20. You will need to configure PHP to use an SMTP server, however as GMail requires a secure login you wont be able to configure PHP to use your GMail account. You will need to find an SMTP server you can access without having to login to it.
×
×
  • 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.