Jump to content

Search the Community

Showing results for tags 'parameter'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (Dreamweaver, Zend, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 3 results

  1. I cannot seem to figure this bit out. I'm trying to load data from an xml file depending on what the value of a url parameter is. I have an attribute set in my xml, but cannot seem to figure out how to go about this. I've looked at several examples of getting the attribute so I'm not sure where I am wrong since I haven't come across an example using url parameters to determine what data should be fetched. Here is what I have so far. An example of my xml file. There will be more records of piercing in this file. <piercings> <piercing id="default"> <title>Piercing Not Specified</title> <names>N/A</names> <gauge>0</gauge> <healing>0</healing> <risk>None</risk> <description>You must first choose a specific piercing from the menu to view information.</description> <aftercare>Aftercare tips will be available once you choose a specific piercing from the menu.</aftercare> <avoid>Things you should avoid will be listed once a specific piercing has been chosen.</avoid> <img>http://via.placeholder.com/350/000000/676767?text=Not%20Specified</img> <additionalimgs> <additionalimg>http://via.placeholder.com/350/000000/676767?text=Not%20Specified</additionalimg> </additionalimgs> </piercing> <piercing id="incomplete"> <title>Listing Incomplete</title> <names>N/A</names> <gauge>0</gauge> <healing>0</healing> <risk>None</risk> <description>The listing for this piercing is incomplete. Once completed the data will appear on this page. Please check back later.</description> <aftercare>Aftercare tips will be available once you the listing is complete.</aftercare> <avoid>Things you should avoid will be listed once the listing is complete.</avoid> <img>http://via.placeholder.com/350/000000/676767?text=Incomplete</img> <additionalimgs> <additionalimg>http://via.placeholder.com/350/000000/676767?text=Incomplete</additionalimg> </additionalimgs> </piercing> <piercing id="antieyebrow"> <title>Anti-Eyebrow</title> <names>Anti-Eyebrow, Teardrop</names> <gauge>16</gauge> <healing>6 - 8</healing> <risk>Rejection/Migration, Scarring</risk> <description>The anti-eyebrow piercing is located on the upper side of the cheek bone right below the orbital socket of the eye. This piercing is most commonly pierced using a 16 gauge curved barbell or custom bent jewelry. This piercing may also be referred to as a teardrop piercing.</description> <aftercare>It is recommended with this piercing to clean twice a day using saline solution or antibacterial soap. Do not overclean. Irritation from overcleaning can result in migration of the piercing. </aftercare> <avoid>Using rubbing alchohol as a cleaner. Changing the jewelry for atleast 3 weeks although recommended to wait until the piercing is fully healed. Pools/hot tubs especially those with chemical cleaners in them. Swimming holes, creeks, rivers, etc. due to bacterial exposure risk.</avoid> <img>http://jessetoxik.com/img/display/stock/antieyebrow_default.jpg</img> <additionalimgs> <additionalimg>http://jessetoxik.com/img/thumb/stock/antieyebrow_1.jpg</additionalimg> <additionalimg>http://jessetoxik.com/img/thumb/stock/antieyebrow_2.jpg</additionalimg> <additionalimg>http://jessetoxik.com/img/thumb/stock/antieyebrow_3.jpg</additionalimg> </additionalimgs> </piercing> </piercings> So for this one I am trying to pull all of the data for the piercing with the attribute of id="antieyebrow". Here is what I tried to retrieve that. URL: http://example.com/piercing.php?location=antieyebrow. if (file_exists($_SERVER['DOCUMENT_ROOT'].'/info/piercing/piercings.xml')) { $piercingxml = simplexml_load_file($_SERVER['DOCUMENT_ROOT'].'/info/piercing/piercings.xml'); $location = $_GET['location']; $piercingid = $piercingxml['id']; } else { $piercingxml = simplexml_load_file($_SERVER['DOCUMENT_ROOT'].'/info/piercing/default.xml'); $location = "default"; } And finally to display the data onto the page: echo $piercingxml->$piercingid[$location]->title; So far nothing from the file is being displayed. How do I accomplish this? Any help as to where I went wrong would be greatly appreciated.
  2. Hi guys, please help me to solve my problem. i want to get the url parameter using / for now i use index.php?category_id=14 how can i change the ?category_id=14 to index.php/14 thank you so much.
  3. Hello everyone! I would like to need some help from someone who understands the basics of PHP. About the problem: I am supposed to make the user's input number multiple (a number between 0 and 10) with the text string the user has written. For example, the user writes "Hello" and "5", "Hello" should be printed out five times. I must use a for-loop and a while-loop to solve it.) Maybe it has to do with something called parameter. Would be thankful for some help! This is my current code: <form method="POST"> Message: <input type="text" name="message"/> Number: <input type="text" name="number"/> <input type="submit" value="OK!" name="submit" /> </form> <?php if(isset( $_POST["submit"] ) ) { $message = $_POST["message"]; $number = $_POST["number"]; ?> <?php for ($random = 0; $random < 10; $random = $random + $number) { echo "<ul><li>$message</li></ul>"; } ?> <?php } ?>
×
×
  • 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.