Jump to content

shanejones

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Everything posted by shanejones

  1. The way I was going to do it was linking to the page with <a href="products/this-is-the-product-slug">The Page</a> so nowhere on the site can you see "products/index.php?id=1" Need to hack wordpress I think to see how they do it. Thanks
  2. I have the slugs in my database all ready to roll its just working out the correct .htaccess code to get it to access a query. Can't seem to find any real world examples.
  3. Rather than me have all my pages as domain.com/index.php?id=1 etc I would like to pull the id's title from the database to create the URL so that they will look like domain.com/this-is-the-page-name/ Wordpress does it exactly how I want i just need a nudge in the right direction. Anyone know how to do it or now of a guide to help me. Thanks
  4. Solved my issue by using file_get_contents() to put the XML contents into a string and then user preg_replace to remove the g: values. then parsed it as normal. Thanks for you help.
  5. Ok so adding the angled bracket and quote stops it from erroring. Now I have an issue with it not pulling the data from the XML file. It now looks like this $rss_xml = SimpleXML_Load_String($rss_data); foreach ($rss_xml->channel->item as $item) { echo $item->title; echo "<br />\n"; echo $item->link; echo "<br />\n"; echo $item->description; echo "<br />\n"; echo $item->{'g:price'}; echo "<br />\n"; echo $item->{'g:image_link'}; echo "<hr />\n\n"; } The XML file is here if you need to see the source. www.manuallinkbuilding.co.uk/index.php?rss=true&action=product_list&xmlformat=google Thanks
  6. I am trying to parse an XML file and there are some values that contain a : as you can see below. $rss_xml = SimpleXML_Load_String($rss_data); foreach ($rss_xml->channel->item as $item) { echo $item->title; echo "<br />"; echo $item->link; echo "<br />"; echo $item->description; echo "<br />"; echo $item->g:price; echo "<br />"; echo $item->g:image_link; echo "<hr />"; } For some reason because of this : I get the error. HP Parse error: syntax error, unexpected ':', expecting ',' or ';' in /home/blah/blah/blah/index.php I have tried escaping it with a \ and also quoting the last element in the echo but it still will not have it. Any suggestions. Thanks
  7. Ok so I have these 2 functions set up to secure some things make_safe() is used before putting anything in the database. the make_viewable() function is used to display the data that was made safe. function make_safe($string) { // used before adding to db return addslashes($string); } function make_viewable($string) { // used before displaying anywhere return stripslashes($string); } is this enough or is there anything else to make this secure. Thanks Shane
  8. Should that go in the destination part then? what is this getcwd() too?
  9. I am using a script found off the web to upload file and show a ajaxy waiting image. In the code for the actual upload is this code $destination_path = getcwd().DIRECTORY_SEPARATOR; $result = 0; $target_path = $destination_path . basename( $_FILES['myfile']['name']); if(@move_uploaded_file($_FILES['myfile']['tmp_name'], $target_path)) { $result = 1; } I am running it from domain.com/label/manage/add-file/upload.php and it uploads the file to domain.com/label/manage/add-file/ How can I upload the file to domain.com/files/123/432/ Do I need to modify the destination path? Also do i need to start it from /home/user/......... Thanks
×
×
  • 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.