Jump to content

Giddy Rob

Members
  • Posts

    63
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Giddy Rob's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks guys, yeah, kinda figured that out just after i posted this. Seems to work ok if you use a textarea to show the code. Just styled it so it doesnt look like one. Any problems doing it this way? Cheers
  2. Hi, bit stuck on how to find and replace "<" and ">" with "<" and ">". I basically have a database record that outputs to screen and I need the code in the <code> tags to be rendered to the screen. I therefore need it to go through the whole array variable from the db and change the symbols just inside the code tags. Please be aware that the code tags might happen more than once here's an example below <p>blah blah blah</p> <p>blah blah blah</p> <p>blah blah blah</p> <code> <h1>hello</h1> </code> <p>blah blah blah</p> <p>blah blah blah</p> <p>blah blah blah</p> <code> <h1>hello</h1> </code> the desired output would be: <p>blah blah blah</p> <p>blah blah blah</p> <p>blah blah blah</p> <code> <h1>hello</h1 </code> <p>blah blah blah</p> <p>blah blah blah</p> <p>blah blah blah</p> <code> <h1>hello</h1 </code> help on this would be great Cheers Rob
  3. hmmmmm, helps if i specify the file to be saved first time done this so hey
  4. Hi, I have found a nice little script to write to the xml file for google, but it appears not to be updating the file. Could someone please let me know what might be wrong as this is the first time I've tried to do this. $dom = new DomDocument('1.0', 'utf-8'); $dom->load('../sitemap.xml'); // if it's a string, $dom->load($xmlFile) if is a file // create the new node element $node = $dom->createElement('url'); // build node $node->appendChild($dom->createElement('loc', $title)); $node->appendChild($dom->createElement('lastmode', date(Y-m-d))); $node->appendChild($dom->createElement('changefreq', 'monthly')); $node->appendChild($dom->createElement('priority', '2')); // append the child node to the root $dom->documentElement->appendChild($node); // get the document as an XML string $xmlStr = $dom->save(); I was wondering if it was something to do with the [urlset] tag within the xml file I'm using? The xml file is just a standard google sitemap.xml Any help on this would be great Cheers Rob
  5. Hi, I want to separate out the file name from an image url. Not sure the best way to do it? I want to basically select all text after the last / slash. eg - image.jpg would be the result from http://www.google.com/images/image.jpg What's the best way to do it? Cheers Rob
  6. Hey, I need to change the url so that "www.website.com/item.php?id=1504" will read something more user friendly and better seo. I've heard you do it with a mod_rewrite, but have never done this before so was wondering if someone could show me how? it would be nice if I could output "www.website.com/newstitle_1504.html" where newstitle is the title of the news item being displayed ie this will be different for each article Example would be great Cheers
  7. Hey, can someone please tell me why the code below will not add a value to a hidden field, but it will output to screen: <SCRIPT LANGUAGE="Javascript"> <!-- // Array of day names var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday", "Thursday","Friday","Saturday"); // Array of month Names var monthNames = new Array( "January","February","March","April","May","June","July", "August","September","October","November","December"); var now = new Date(); var super = (dayNames[now.getDay()] + ", " + monthNames[now.getMonth()] + " " + now.getDate() + ", " + now.getFullYear()); // --> </script> <body><script>document.write(dayNames[now.getDay()] + ", " + monthNames[now.getMonth()] + " " + now.getDate() + ", " + now.getFullYear()); document.getElementByID("newsdates").value = (super);</script> <input type="hidden" name="newsdates" id="newsdates" value="" /> </body> </html> When I load the page it should add the date to the value by id, but I cant get it to work. Thanks in advance Cheers Rob
  8. Hey, I am dealing with a table that has about 500 records. My problem is that I need to create an index and auto fill it from 1-500 (not manually). Once this is done I would like the table to autoincrement when a new record is added. I have set up a field called 'item_number', which is the index field. What php/mysql code do i need to run to fill the table from 1 (first record) to 500 (last record)? I'm hoping I can convert it to an index and autoincrement in phpmyadmin once this is done. At the moment if I try this I just get an error, duplicate field. I did ask in the mysql forum but seems a bit of a ghost town Cheers Rob
  9. BTW, the table is full of information so I dont just want to create a new table
  10. Hey, I am dealing with a table that has about 500 records. My problem is that I need to create an index and auto fill it from 1-500 (not manually). Once this is done I would like the table to autoincrement when a new record is added. I have set up a field called 'item_number', which is the index field. What php/mysql code do i need to run to fill the table from 1 (first record) to 500 (last record)? I'm hoping I can convert it to an index and autoincrement in phpmyadmin once this is done. At the moment if I try this I just get an error, duplicate field. Cheers Rob
  11. Hi, I am a little stuck as I need to resize an image then get the width and height for a record in my database. What I am basically trying to do is have a set of three constraints for the size or a custom size the user can set. For example if one option says"400 height || 400 width" then the width or the height will be set to a maximum of 400px, depending on the which is the largest (keeping aspect ratio). The custom just allows them to set the width and height themselves. It was previously done with this command below, but the system has now moved servers so it doesn't work anymore as I don't think I have permission to use the system call. if ($_POST['picsize'] == 'S') {$_POST['maxwidth']=100;$_POST['maxheight']=100;} if ($_POST['picsize'] == 'M') {$_POST['maxwidth']=250;$_POST['maxheight']=250;} if ($_POST['picsize'] == 'L') {$_POST['maxwidth']=400;$_POST['maxheight']=400;} if ($_POST['maxwidth'] > 0 && $_POST['maxheight'] > 0) { system("/usr/local/bin/convert -quality 80 -thumbnail {$_POST['maxwidth']}x{$_POST['maxheight']}\\> \"{$_FILES['ins_image']['tmp_name']}\" \"../news_images/{$_FILES['ins_image']['name']}\""); } I would like to do this with imagemagick if possible. Any help would be great Cheers in advance Rob Shillito
  12. thats what I thought. I am just looking at phpbb and it looks like just the ticket Cheers for the advice.
  13. Hi, I have never created or integrated a forum into a website before so I was wondering what would be the most simple way of doing it? Is it easier to plug in a forum thats already been created (if so which one is simple and cheap?) or to just code one up myself? If I do a simple one myself how long should it take about? Rough gestimate would be great. Cheers in advance Rob
  14. Hi, thanks for the response but for some reason the money function messed up the shopping cart, which seems very strange when all it appears to do is reformat the array value for outputting to the screen. I have used the number_format() function and this seems to work perfectly. Any clues why this might cause a problem? Cheers Rob
×
×
  • 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.