Jump to content

melting_dog

Members
  • Posts

    118
  • Joined

  • Last visited

    Never

Posts posted by melting_dog

  1. Hi guys,

     

    Thanks for all the help!

     

    Yep I fully agree that it's not good practice to store data this way -  I certainly wouldn't do it. Unfortunately I am working with a clients pre-existing database so dont have much choice in the matter.

     

    Thanks for all the input but I still can't get it to work. I have:

     

    $data = explode('\n', $row['description']);

    echo '<span class="productdescription">'. $data . '</span>';

     

    But all this returns is the word 'Array'

     

    Does anyone know how to improve this? Do I need to loop through this array?

     

    Thanks!

     

  2. Hi all,

     

    I am working on a site for a client so there is an existing database. I have a simple query:

     

    $sql3 = "SELECT * FROM product_finish WHERE product_id = $prodid";

    if($result3 = mysql_query($sql3)){

    if(mysql_num_rows($result3)) {

    while($row = mysql_fetch_array($result3)){

     

    echo $row['finish_id'];

     

    }

    }

    }

     

    Which is all syntactically correct, BUT it returns noting....even if run it in phpMyAdmin and hard code it so the $prodid is, say, 4 instead. I can see the data when I browse the data, just the query will not fetch it.

     

    Can anyone give me some advice? Thanks heaps again!

  3. Hi all,

     

    I posted a similar question before and got some of the way but still need a little help.

     

    I have a product database with a description column where there are strings broken into lines. I need to find a way to explode() by line break. Currently explode("/n") doesn't work - it only returns one array item. Can anyone help me out?

     

    Thanks!

  4. Hi all,

     

    I am using a custom font with CSS3 and it works fine in Chrome and Firefox, but as suspected, not in IE. The issue is that the custom fault I have is smaller then the normal, default sans-serif font. So what appears as a 35px font size is actually a 50px font size. When I view the site in IE the default sans-serif font then looks massive.

     

    Does anyone know of a way to tell IE (and just IE) to make the font smaller?

  5. Hi guys,

     

    I have a list of products and I want to create a way to display similar products when a user views a particular product. I am thinking about doing it a certain way but need some advice on how to make it happen. I think I would do it like:

     

    Get the name of the existing product

    explode() the name by space" " e.g (explode(" ",$productname));

    place the reuslts in a query that looks like:

     

    SELECT * FROM product WHERE name LIKE '%$arrayitem1% OR LIKE '%arrayitem2%  OR LIKE '%arrayitem3%''

     

    Im pretty fuzzy on the whole explode() part. Can anyone please give me some advice or point me in the direction of a similar tutorial/piece of code?

     

    Thanks heaps!

  6. Hi all,

     

    Weird one: I am re-working a site for a client. Their old site currently grabs text from a DB and somehow automatically puts it into a <ul>. The only thing to signify a <li> is a linebreak. So if I entered:

     

    Item 1

    Item 2

    Item 3

     

    into the database, they would come out looking like:

     

    • Item1
    • Item 2
    • Item 3

     

    on the site. Anyone know of a way to recreate this?

     

    An example of this in action is here: http://www.postureperfection.com.au/Chairs/Amore_Chair/p/495/ (please remember - I am redesigning the site!)

     

    Thanks heaps!

  7. Very nice! Good use of space and breaking things up into section. Very clean and clear and its really straight forward which is great for what your selling. Tagline is great for SEO. I like the red button - its kind of an Easter egg on the site. If I had to choose something I didnt like, it would be the text shadowing in the footer. But that would be very pernickety of me!

  8. Hi all,

     

    Sorry if this is in the wrong forum - but I was hoping for some advice.

     

    I am creating a 'product showroom' site for some clients and I wanted to get peoples advice on how much I should charge for it.

     

    I don't feel completely comfortable charging my normal hourly rate as quite a bit of it is mindless/skill-less data entry. I have an idea of the price but it would be great to get 2nd opinions.

     

    It is a large 'product showroom' site built of Wordpress. It has a lot of custom PHP to retrieve information of products from a database. There are several categories so many different queries are needed. There will be a back end that will allow the creation of new products, along with the uploading of new images and removal/editing of existing entries. There will be ways to allow a selection of products to appear in a Specials area. As yet there is no ecommerce section.

     

    A breakdown of the work involved would look like:

     

    -About 18hrs data entry

    -Site design and mock ups in Photoshop

    -Custom Wordpress theme Creation

    -Custom PHP and MySQL scripts for returning product info

    -Building back end to allow product list to be updated

    -Adding and configuring of various WP plugins (contact forms, slideshow)

    -WP training

     

    Sorry I cannot be more specific with the time it takes for each.

     

    Any advice on an hourly rate or overall price would be appreciated!

  9. Hi Thorpe

     

    - yes I have looked at the xxamp file. I googled a fix on the 403 error and most sites recommend I change the line 'Allow from localhost' to 'Allow from 127.0.0.1'

     

    I tried to find the line but my file has this instead:

     

    <LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">

        Order deny,allow

        Deny from all

        Allow from ::1 127.0.0.0/8 \

                  fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \

                  fe80::/10 169.254.0.0/16

     

        ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var

    </LocationMatch>

     

    Would you know how I could modify this to help?

     

    Cheers

  10. Allright - un update on this, sorry for the delay - was away overseas.

     

    I decided to just past the entire first part of the path in to see what happens:

     

    echo '<img src="http://localhost/xampp/website/uploads/'. $row['itemimage'] . '"/>';

     

    Still got no image, so I opened up firebug. I see the complete image path in the code there that should be working, but with a little message saying it failed to load the image.

     

    I copied the entire path into my browser and got a 403 error:

     

    Access forbidden!

     

    New XAMPP security concept:

     

    Access to the requested object is only available from the local network.

     

    This setting can be configured in the file "httpd-xampp.conf".

     

     

    Is this something to do with XAMPP? I tried googling it and couldnt find anything to that helped. Can someone point me in the right direction?

     

    Thanks!

     

     

  11. Hi guys -  a bit of a wierd one - I have installed a plugin that allows me to run PHP from a WP post or page - but I am having difficulty (probably with the syntax) when echoing an image. I know I must use the bloginfo("template_directory") but I am not sure how to include it in an echo - especially drawing the image path form a DB row..

     

    eg:

     

    echo '<img src="' . bloginfo("template_directory") . $row['itemimage'] . '"/>';

     

    In this form, the template directory path is simple printed to the screen as a string - the image itself fails to appear. I simply cannot get this to work.

     

    Can any one help me out? Sorry if this is unclear.

     

    Thanks heaps again!

  12. Hi Haku,

     

    Yes the hidden field is part of a form with a post method. All other fields in the form (text fields) are able to be received by the php on the other page. Its just this hidden field with the javascript that is not working.

     

    Here it is in more detail - its just meant to be passing the date and time the form was completed so the DB is updated:

     

    <!--GET CURRENT DATE-->

    <script type="text/javascript">

    var currentTime = new Date()

    var month = currentTime.getMonth() + 1

    var day = currentTime.getDate()

    var year = currentTime.getFullYear()

    var curdate = (day + "/" + month + "/" + year)

    </script>

     

    <form id="submitphotodetails" method="post" action="submitphotodetailprocess.php" enctype="multipart/form-data">

    <input type="hidden" name="date" id="date" value="<script>document.write(curdate);</script>"/>

    ---OTHER FORM FIELDS AND SUBMIT BUTTON---

     

    And on the next page:

     

    $date=$_POST['date'];

    $date = stripslashes($date);

    $date = mysql_real_escape_string($date);

  13. Hi guys,

     

    Sorry - this might more belong in the SQL section but I think it is PHP related. I am trying to update a table with:

     

    $sql="UPDATE $tbl_name SET (gender, description)  VALUES ('$gender', '$description') WHERE image = ('$photoname')";

    $result=mysql_query($sql);

     

    Needless to say, its not working. Only odd thing is that the $photoname variable is sent with a hidden field on the previous form. I can echo all 3 varaibles though and get the right results. I just dont know why it isnt updating - seems pretty standard to me.

     

    Can anyone help?

     

    Thanks!

  14. Sorry guys, I just posted this before but must have hit send in its incompleted state. What I meant to say is:

     

    Hi guys,

     

    I am trying to retrieve some information from sessions. I have this in my header.php

     

    <?php if(isset($_SESSION['username'])){

     

    $username = $_SESSION['username'];

     

    echo $username;

              } ?>

     

    And it works fine - $username returns and prints the correct string.

     

    But when I try the same echo on another file (that includes() header.php) I just get the word 'root'  - not the actual user name

     

    Can anyone help me with this?

     

    Thanks again!

×
×
  • 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.