Everything posted by Chris.R
-
PHP5 and XML HELP! :(
Hey Jay, How would I go about echoing all the images out on the page for each item rather than just one? some items have multiple images and some have none :S Thanks, Chris
-
PHP5 and XML HELP! :(
Thats great! so annoyed I didnt try that Thanks for your help!!
-
PHP5 and XML HELP! :(
its on the same server This is the code that I am using so far.. $inventorylink = 'inventory.xml'; $feed = simplexml_load_file($inventorylink); // Display Results foreach ($feed->item as $item) { echo "<tr>"; echo"<td><strong><a href=\"\" title=\"\">$item->title</a></strong></td>"; echo "<td rowspan=\"2\" style=\"vertical-align:top; padding-bottom:15px;\">$item->Images->img[1]->attributes()->src</td>"; echo "</tr>"; echo "<tr>"; echo "<td><strong>Features:</strong> $item->description <br /><a href=\"\" title=\"More Details On The $item->title\">More Details</></td>"; echo "</tr>"; } I hope this makes sense Thanks, Chris
-
PHP5 and XML HELP! :(
Hi there, I have an XML file with the following structure, <item> <name></name> <description></description> <Images> <img src="" alt="" width="" height="" /> <img src="" alt="" width="" height="" /> <img src="" alt="" width="" height="" /> <img src="" alt="" width="" height="" /> </Images> </item> their are about 100 items but when i loop through each item and echo them onto the screen I only one to display one of the images that is listed.. Can anyone help me with the code to display just one? I have tried: $item->Images $item->Images->img[1]->attributes()->src but this does not seem to display anything and I know that using children() will just show a count of the children.. Im pulling my hair out and it seems like such a small problem Thanks, Chris
-
PHP Switch/Case Statement Advice
Hi there, I know a switch statement checks for the exact match of a variable but I was wondering if it could do a check to see if a sentance contained a certain word? eg. <?php $x = "I have a cat"; switch ($x) { case "Cat": echo "they have a cat"; break; case "Dog": echo "they have a dog"; break; case "Turtle": echo "they have a turtle"; break; default: echo "No Pets"; } ?> I dont want to have to write lots of IF statements and wondered if this was possible before I start coding up a large switch/case statement.. Thanks, Chris
-
Not something you want to wake up to :(
I tired to get it off with warm soapy water but it just seemed to make it worse. Took it too the body shop and they are going to see if they can get it off.. Waiting for the phone call tommorrow morning I will most likely leave it at uni and walk down to it when I need it. Its just annoying that people cant just leave their car outside their own house! Thinking of rigging up a camera out the window and see if I can see who did it, If I find them, there will be grief..
-
Not something you want to wake up to :(
Woke up this morning to find someone has decided to make my week a bad one Ive lived down the road for 6 months and havent made any enemies. If I find the person who did it, there will be trouble!
-
contact form not working on my new server
Something I saw when looking at your PHP Info is that there is no path assigned to SendMail.. which surely means if it was trying to send an email it would fail due to Send Mail not being enabled.. Take a look: sendmail_from no value no value sendmail_path no value no value Just a thought.. maybe they havent configured their PHP.ini file correctly yet, although i see the server was built in May 2008!?? Top of the info page: Build Date May 2 2008 19:36:50 Sorry if this is completely incorrect, just my two pennies Chris
-
PHP5 and XML
Thats great, thanks guys Ill give it a whirl! Thanks, Chris
-
"Databases within website design" module with Open University...
Thats terrible for the OU, I would definetly have a word with them, sounds like they are teaching you outdated versions which will not benefit you at all once you finish your course/degree.. If your going to do a course, I would focus on ASP.Net (Expensive) or PHP (Free) Chris
-
PHP5 and XML
Here is a sample schema of the XML file The <Product> Tag is a repeating tag.. <allproducts> <timestamp>04/01/2010 00:30:49</timestamp> <version>2.0</version> <products> <product type="main"> <code>Code101</code> <name>Product Name</name> <description>Description</description> <measurments> <imperial>na</imperial> <metric>na</metric> </measurments> <power> <powertype>None Required</powertype> </power> <price> <wholesale>3.34</wholesale> <rrp>10.49</rrp> </price> <categories> <range category="product category1">Sub-Category 1</range> <range category="product category1">Sub-Category 2</range> <range category="product category1">Sub-Category 3</range> </categories> </product> <product type="main"> <code>Code102</code> <name>Product Name</name> <description>Description</description> <measurments> <imperial>na</imperial> <metric>na</metric> </measurments> <power> <powertype>None Required</powertype> </power> <price> <wholesale>3.34</wholesale> <rrp>10.49</rrp> </price> <categories> <range category="product category1">Sub-Category 1</range> <range category="product category1">Sub-Category 2</range> <range category="product category1">Sub-Category 3</range> </categories> </product> </products> </allproducts> Thanks, Chris
-
PHP5 and XML
Hi there, I am wondering if someone could give me a pointer.. Im using the simplexml_load_file funciton to load an xml file into an array, to get the contents of each item in the xml document im using a For Loop but with some of the items in the XML file it has the following: <categories> <range category="Category1">Subcategory 1</range> </categories> How can I retrieve both the Category1 and Subcategory while doing my loop? I can only seem to get the Subcategory1 within the "Range" tag.. Ive had a look on google but im not sure what to search for to get my answer? Help! Happy New Year! , Chris
-
CSS Padding Issue
Sorry for the late reply, Try this and let me know how it works out, it should solve the problem.. <html> <head> <title>CSS Navigation</title> <style> #topnav { background: #fff url(http://www.miltonglassuk.co.uk/Milton%20Glass/images/bigbox.gif) no-repeat top left; height: 64px; text-align: center; margin: 0 auto; width:1090px; } #topnav ul { padding-top:5px; } #topnav li { color: #000; background: url(http://www.miltonglassuk.co.uk/Milton%20Glass//images/barbg.gif) no-repeat; display: inline; list-style-type: none; padding: 6px; } #topnav a { border:none; text-decoration:none; color:#000; } #topnav img { border:none; } </style> </head> <body> <div id="topnav"> <ul> <li><a href="#"><img src="http://www.miltonglassuk.co.uk/Milton%20Glass/images/icons/house.png" alt="Portsmouth Branch" class="nohyperlink" title="Portsmouth Branch" /> Portsmouth Branch</a></li> <li><a href="#"><img src="http://www.miltonglassuk.co.uk/Milton%20Glass/images/icons/house.png" alt="Cosham Branch" class="nohyperlink" title="Cosham Branch" /> Cosham Branch</a></li> <li><a href="#"><img src="http://www.miltonglassuk.co.uk/Milton%20Glass/images/icons/house.png" alt="Waterlooville Branch" class="nohyperlink" title="Waterlooville Branch" /> Waterlooville Branch</a></li> </ul> </div> </body> </html> Chris
-
CSS Padding Issue
I'm not near a computer tonight but I'll take a look tommorrow. Don't worry we will get it sorted Chris
-
CSS Padding Issue
No problem bud, glad to be of help it's a great forum for help! Good luck with the site Chris
-
CSS Padding Issue
Just had a play about on my comp, try this: <html> <head> <title>CSS Navigation</title> <style> #topnav { background: #fff url(http://www.miltonglassuk.co.uk/Milton%20Glass/images/bigbox.gif) no-repeat top left; height: 64px; text-align: center; margin: 0 auto; width:1090px; } #topnav ul { padding-top:5px; } #topnav li { color: #000; background-color:#FFF; display: inline; list-style-type: none; padding: 6px; } #topnav a { border:none; text-decoration:none; color:#000; } #topnav img { border:none; } </style> </head> <body> <div id="topnav"> <ul> <li><a href="#"><img src="http://www.miltonglassuk.co.uk/Milton%20Glass/images/icons/house.png" alt="Portsmouth Branch" class="nohyperlink" title="Portsmouth Branch" /> Portsmouth Branch</a></li> <li><a href="#"><img src="http://www.miltonglassuk.co.uk/Milton%20Glass/images/icons/house.png" alt="Cosham Branch" class="nohyperlink" title="Cosham Branch" /> Cosham Branch</a></li> <li><a href="#"><img src="http://www.miltonglassuk.co.uk/Milton%20Glass/images/icons/house.png" alt="Waterlooville Branch" class="nohyperlink" title="Waterlooville Branch" /> Waterlooville Branch</a></li> </ul> </div> </body> </html> see it working here Thanks, Chris
-
CSS Padding Issue
Hey, Why dont you use CSS to change the <UL> item from List Style to Block Style? this should place them next to eachother horizontally and then you can apply any padding/margins to the individual <LI> elements. HTML //HTML <div> <ul id="navlist"> <li><a href="#">Item one</a></li> <li><a href="#">Item two</a></li> <li><a href="#">Item three</a></li> <li><a href="#">Item four</a></li> <li><a href="#">Item five</a></li> </ul> </div> CSS #navlist li { display: inline; list-style-type: none; padding-right: 20px; } Then just change the CSS stylign to reflect your background images, width and the required padding.. Chris
-
How To Server Same Content On Several Sites From Same File
Sorry if this sounds a bit simple but surely you could just do a simple include and place the full URL of the shared content in the include? <?php include('http://your-domain-here.com/textdocument.txt'); ?> Place that on the sites that require the same text and boom, bobs your uncle? It works for my sites, but they are all hosted with the same hosting company.. Chris
- Count to 1 million
- WDF Twitter Repository
-
what you think of my new idea
Is the link still active? I tried taking a look on an IE7 machine and its just a plain white screen.. Thanks, Chris
-
URL Shortener
As Shaun Said: Use an .htaccess file to determine the URL shortner link (eg. domain.com/short/2323) Anything that is parsed to the domain foolwing "Short" will be picked up by the htaccess file and redirect to the correct page, you would need a php file with dynamic header information for the different links. Id be happy to help, if you need more help send over a PM Thanks, Chris
-
Mashups Google/Twitter
Thanks, Got it sorted finaly you can see it in action here: http://www.carose.co.uk/test.php
-
Mashups Google/Twitter
Ive managed to get the last 5 tweets from my friends and I have pulled their name and location from the xml file. I wanted to use this array to plot their name and location on a googlemap.. $twitterfollowxml = simplexml_load_file('http://twitter.com/statuses/public_timeline.xml'); $i = 0; while ($twitterfollowxml->status[$i]) { echo $twitterfollowxml->status[$i]->user->id."<br />"; echo $twitterfollowxml->status[$i]->user->location."<br /><br />"; $i++; } at present it returns the id and location(if set) I just wanted to pass these to a googlemap API that would just plot them but the API documentation is not very clear and ive looked online to no avail Chris
-
Mashups Google/Twitter
Hi, im trying to play around with making a mashup of Twitter and Google Maps, I have got an array from an XML file of locations in the format ("London, UK" "Swindon, Wiltshire" etc..) I was wondering if anyone knew of how to get these locations put on a Googlemap on a webpage.. Ive got my API key and tried to do it, but I just cant seem to get the hang of it and get it to work.. Ive spent 6 hours on it today and have not been able to create anything useful :S HAs anybody had any experience of this that they could help me out with? If you help and you live near, theres a pint/glass of wine in it waiting for you Thanks, Chris