Jump to content

jasonc

Members
  • Content Count

    842
  • Joined

  • Last visited

Everything posted by jasonc

  1. With the new GDPR in place for site owners, should all sites have a contact page/means to make contact site owners ? Is it somewhere in the policy that this is so ? if so where ?
  2. I have looked at the children() link but its gone completely over my head. It looks like the only way I can do this is the long way and search the html code for the <dt>item7:</dt> then grab the text within the next element if the text was found. I was just wondering if there was an easier way of doing this without all the extra code.
  3. The code is from a third-party site which I wish to get certain content from. I am wanting to search within the "b" class (there is only on in the source code!) for the <dt>item7</dt> then grab the content of the element that follows it. the otherwise return an empty string $b = ' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html"> <head> </head> <body> <div class="b"> <dl> <dt>item1:</dt><dd>1</dd> <dt>item2:</dt><dd>2</dd> <dt>item3:</dt><dd>3</dd> <dt>item4:</dt><dd>4</dd> <dt>item5:</dt><dd>5</dd> <dt>item6:</dt><dd>6</dd> <dt>item7:</dt><dd>7-</dd> <dt>item8:</dt><dd>8</dd> <dt>item9:</dt> </dl> </div> </body> </html> '; $b = new SimpleXMLElement($b); echo $b->dl->dt; // echo the content of <dd> only if the previous <dt> node has the text 'item7' in it.
  4. If I done a JSFiddle it would be the same code. I recreated the same problem using my original code and stripped out everything that was not needed to show my issue. The right side select is the issue. I am wanting the options 'container' to be right aligned to the select as shown in the image I added in the OP
  5. For the sake of simplicity I have used instyle. I am wanting the right side select to have its option 'container' to be moved over to the left so it is like that in the image in my first post. <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style> .form2 { width: 200px; margin: 0 auto; padding: 0.5em 0.5em 0.5em 0.5em; } .form2 input.field { float: left; width: 100%; height: 2em; border: 0.02em solid #000; line-height: 1.7em; font-size: 0.9em; padding: 0.2em; } .form2 select { } .form2 select.field { float: left; width: 100%; height: 2em; border: 0.02em solid #000; line-height: 1.7em; font-size: 0.9em; padding: 0.2em; } </style> </head> <body> <form class="form2" id="form2" name="form2" method="post" action=""> <div style="float: left; width: 48%;"><select class="field" title="Select Stairs, Lift or N-A" name="stairliftna" id="stairliftna"><option value="Select Stairs, Lift or N-A">Select Stairs, Lift or N/A</option><option value="Stairs">Stairs</option><option value="Lift">Lift</option><option value="n-a">N/A</option></select><br><br> </div> <div style="float: left; width: 4%;"> </div> <div style="float: left; width: 48%;"><select class="field" title="Select Packing service" name="packingservice" id="packingservice"><option value="Select Packing service">Select Packing service</option><option value="Self packing">Self packing service</option><option value="Part packing">Part packing service</option><option value="Full packing service">Full packing service</option></select><br><br> </div> <br class="clearFloat"> </form> </body> </html>
  6. I have been looking via google and this forum but still no closer to finding the answer to this. I have a select that is in the right side of my page but the options are jumping out to the right side of the page. So I am looking to get the 'container' moved to the left so it is aligned to the right of the select.
  7. Hi, Are you still looking for a coder ? Cheers Jason
  8. I wish to read all data from a DB table and display it. Displaying each record, if there is a character is between x0 and x7F then wrap it in a span that will highlight it using CSS.
  9. I wish to highlight the special characters that fall within the following range x00 to x7F Please can someone advise how could I do this ?
  10. I downloaded Netbeans and installed it and like the look of it. I have not had an major issues with uploading any of my custom written files directly to the server using DW. (from the errors point of view) I would really like to have it all setup just like I had with DW, where I edit the files and it saves it locally and then immediately to the server. I have yet to go through all the settings to see what under the hood. But did see something about saving locally for some testing server or something, will have to check that again. Think I will check a bit more of the help pages as well. Are any of the settings files of the project saved to the server ? Change is good sometimes but only if it does not take away some of the original features that I was use to.
  11. I do see your point.. but I like the features of DW. Also the ability of of being able to upload files, folder within the editor at the same time.
  12. When I open a file be it a html or in most of the cases a PHP file the view changes to what it was saved as. So say I have indented a portion of text to 2 or 3 or more tab indents and save the file. When I open it again in dreamweaver the tabs are still there, but the whole portion that was indented is now brought to the next line and taken to the first column and not indented as it was previously saved. If I enit the file in notepad and open it the file is how it was saved as I wanted it. But opening this file in DW and the code gets changed. I have looked through a lot of the settings nad can not find anything that has helped stop this. Even the do not change files with certain extentions stops it. Is there another setting that I have missed that will stop this ?
  13. Please can someone advise how I correctly access each of the nodes in an XML file. echo($geoLocXML->isp . '<br>'); this is what I used before and it worked up to last month, then all of a sudden it failed. I have also tried this code on a different server and it fails there too, so it suggests there is an error in the code, but for the life of me I can not find it. <?php //exit; error_reporting(-1); //$ip = $_SERVER['REMOTE_ADDR']; //$geoLocXML = getGeoLocXML($ip); //->result[0]; //$geoLocXML = file_get_contents('http://api.geoiplookup.net/?query='.$ip); $getGeoLocXML = simplexml_load_file('http://www.mysite.com/getGeoLocXML.xml'); /* $getGeoLocXML = '<?xml version="1.0" encoding="iso-8859-1"? > <ip> <results><result><ip>123.123.123.123</ip><host>123.123.123.123</host><isp>Provider</isp><city>My City</city><countrycode>GB</countrycode><countryname>United Kingdom</countryname><latitude>123.123</latitude><longitude>-1.123</longitude></result></results> </ip> '; */ $geoLocXML = $getGeoLocXML->result[0]; echo($geoLocXML . '<br>'); echo($geoLocXML->isp . '<br>'); echo($geoLocXML[city] . '<br>'); echo($geoLocXML[countryname] . '<br>'); /* <results> <result> <ip>123.123.123.123</ip> <host>123.123.123.123</host> <isp>Provider</isp> <city>My City</city> <countrycode>GB</countrycode> <countryname>United Kingdom</countryname> <latitude>123.123</latitude> <longitude>-1.123</longitude> </result> </results> */ ?> <?xml version="1.0" encoding="iso-8859-1"?> <ip> <results><result><ip>123.123.123.123</ip><host>123.123.123.123</host><isp>Provider</isp><city>My City</city><countrycode>GB</countrycode><countryname>United Kingdom</countryname><latitude>123.123</latitude><longitude>-1.123</longitude></result></results> </ip>
  14. Hi please can you let us know the content of your logout.php file as this is where the error is, as stated in the error message. It's likely that there is some output too soon,
  15. The £ is showing as a diamond for one, I'll have to check for the other characters.
  16. ALTER TABLE `tablename` CONVERT TO CHARACTER SET utf8 [COLLATE utf8_general_ci] I used this but still the text in the data is not showing on the webpage as that of a new entry that is added via my CMS area.
  17. All tables and databases are set to utf-8. Adding/editing new entries is working ok. The actual data in the database which was added ages ago is still in the old format. Is there a way to convert the previous existing data before I changed to the correct method of storing the data.
  18. Yes my page is html5, but some of the code was outdated. It seems that so far all information that I add as new is being stored as is, no change to the text apart from escaping before being added and when displayed all looks ok and of the scripting text I tried this also shows as html entities in the source code. All good so far. But still there is the issue of all the entries in the database that was incorrectly stored. How would I start to convert it to normal text as it would be if I had entered it as of now. £ instead of the chr(163) which shows on the page as a diamond with question mark in it. and the other unicode characters.
  19. ok all seem ok, apart from the £ sign, i get the diamond with a question mark in it. ❤French style nest of table , oh la la �40❤ it should be ❤French style nest of table , oh la la £40❤ ok what I have done is echod out all the ord() codes... 226 � 157 � 164 � 70 F 114 r 101 e 110 n 99 c 104 h 32 115 s 116 t 121 y 108 l 101 e 32 110 n 101 e 115 s 116 t 32 111 o 102 f 32 116 t 97 a 98 b 108 l 101 e 32 44 , 32 111 o 104 h 32 108 l 97 a 32 108 l 97 a 32 163 � 52 4 48 0 226 � 157 � 164 �
  20. Now the big issue I have is to convert everything back to normal text in the database after I have incorrectly converted most if not all special characters to their hash and other formats.
  21. ah after splitting up the line in to sections I found the error... the missing ) all working now, and I see who this works too. Thank you
  22. Yes both of these are already set and in php.ini file. But no errors are logged
  23. ok I use the following to add the entry as it and escape the text in case it contains something it should not... $query="INSERT INTO `tablename` (`id`, `title`) VALUES ('1','".$mysqli->real_escape_string('<script>alert("1");< /script>')."')"; db_query($mysqli, $query); Then to get it back I use... echo(htmlentities($title, ENT_QUOTES | ENT_IGNORE, "UTF-8"); But I get a blank page, not even any source code... so I change it to this... echo($title); and sure enough the alert box shows up. Am I missing something here ? How do I stop code like this from working as the bad poster expected...
  24. I just entered the text as is in the table using my script. escaping the string first.. ❤French style nest of table , oh la la £40❤ and it shows as this in the database... â¤French style nest of table , oh la la £40⤠But the £ and the heart do not show up even when I set the page as UTF-8 I used echo htmlentities($str, ENT_QUOTES | ENT_IGNORE, "UTF-8"); to output it on the page, but the page is blank still and nothing in the source code. in the script I placed this at the start... <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> and the following at the end... </body> </html>
×
×
  • 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.