Jump to content

Love2c0de

Members
  • Posts

    364
  • Joined

  • Last visited

  • Days Won

    1

Love2c0de last won the day on January 2 2013

Love2c0de had the most liked content!

About Love2c0de

  • Birthday 05/03/1989

Contact Methods

  • Website URL
    http://www.tspv-websites.co.uk
  • Skype
    Thomas_c0de

Profile Information

  • Gender
    Male
  • Location
    The Pleiades
  • Interests
    Coding, Money
  • Age
    23

Love2c0de's Achievements

Regular Member

Regular Member (3/5)

12

Reputation

  1. Need my WAMP Server argggghhh got no server :(

  2. PHP number plate! :)

  3. Perfect Dark - N64 - old skooooo

  4. Boss told me he's gonna put me with the developr for a while and get me doing some codingzz!!! w00000p w00000p :D

    1. Love2c0de

      Love2c0de

      better swat up on my c# baby

  5. a state of trance

  6. dang theres more to Excel than I anticipated VLOOKUP >:@

  7. woop woop and another week

  8. Got a weeks trial at a web development company starting monday. Doing some data inputting. Absolutely cacking it! :o

  9. 4am, matches keeping eyelids open, eyes stingin, there just aint enough hours in the day for this. pillow....where are you?

  10. Just played around with your code and it seems to be working now how you want (I think). Check it out: http://jsfiddle.net/BMEXR/44/ You can add any width to the parent div now and your links will always align to the center. This is because your unordered list is spanning 100% of the parent but what really makes it work is setting the text-align: center style. However large your unordered list area is, setting text-align to center will ensure it is always centered within the div. Hope this is your desired result! Kind regards, AotB.
  11. If you want your javascript function to run when they submit the form, you have to add the onclick event handler to the submit button like so: <input type="submit" value="Submit" onclick="incorrectAnswer()" /> When you submit your form, this function will run first. You can return true or false from your javascript function to determine whether to carry on with the submit, or whether to cancel the submit. Let's say your function validates some fields, if the user entered the wrong data, you can return false from the function which will stop the submission to the server. You accommodate this by changing the input tag to this: <input type="submit" value="Submit" onclick="return incorrectAnswer()" /> You return true or false depending on what the results of your 'test' was. False stops the submission, true carries on and executes the php script. If you're having some difficulty, i'd drop the javascript and validate it all with the php. In relation to your value not being echo'd, it might seem quite a silly thing to ask, but you have added the closing semicolon haven't you? It's just in your example there is no semicolon after the echo statement. It's hard to say what it could be. Are you getting any error messages come up? PHP usually tells you exactly where the error is, which is a blessing. Kind regards, AotB.
  12. You can also use: $dir_name = dirname(__FILE__): Once you have the string directory, you can then search the directory for example: $files = scandir($dir_name); echo "<pre>"; print_r($files); echo "</pre>"; Hope it helps. Regards, AoTB.
  13. Have you got any queries? I haven't used the basic mysql functions in a while BUT I think it's something like: $qry = mysql_query("SELECT col FROM table_name WHERE col={$value}"); if(mysql_num_rows($qry) >= 1){ echo "you have an image"; //here you would do something like: $img = mysql_fetch_array($qry); $output_img = "<img src='product_images/{$img['col_name']}' alt='{$img['col_name']}' />"; } else{ echo "no image in database"; } You then just output to your page like so: <?php if (isset($output_img)){ print($output_img);} ?> To deal with multiple images you would do: while($img = mysql_fetch_array($qry)){ $output_img[] = "<img src='product_images/{$img['col_name']}' alt='{$img['col_name']}' />"; } Then: if (isset($output_img)){ print_r($output_img); } You don't just have to print_r() you could then maybe use a foreach loop and do the business in there.
×
×
  • 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.