Jump to content

defeated

Members
  • Posts

    246
  • Joined

  • Last visited

Everything posted by defeated

  1. ok, so it took a few more days for me to get around to it. Didn't work. Heres what I did. renamed the .htaccess file by removing the . so that I could view it in my editor. It was an empty when I opened it. I wrote the following. RewriteEngine On RewriteRule jobs.php/(.+) jobs_ireland.php/$1 [NC,R=301] I wrote a few more lines for other pages but exactly the same as the one above. I get 404 not found if I type in www.jackiebrownmedical.ie/jobs.php?url=jobs Where did I go wrong?
  2. Oh Sh1t!!! Is there no idiots guide to posting xml??? I need something like tizag.com's tutorials to take me from scratch with examples. I'm sure it's just like every other thing to do with the web that I've learnt so far..... not so hard if you know how. But right now it looks like an impossibility... yet tantalisingly close to happening. I have everything in place bar the actual sending of the information. And I need to be able to recieve it to test it. I like that xml parser lets you encode to utf8 but I couldn't figure out if I needed to download something to make the parsing possible or how to use it. I'm sure in a few months it may all make sense but not right now.
  3. I just want to find out how to send and receive xml really. I need to send xml documents to several other sites and I want to set up a receiver on my own site too so that I can test it all without showing the other site owners that I haven't got a clue what I'm doing! I have some very basic php knowledge and have a javascript solution to posting that is no good to me because I don't know how to implement it and would therefor prefer to do the whole thing with php. I can't get my head around what happens to a file when it arrives at my target page. Where should it save it, how does it know to receive a file even. It is all job data (about 19 fields) and requires a username and password to be authenticated. I just need a starting point really and then I can come back with specific questions as they arise.
  4. Since I want to send and receive xml objects is this the right place to ask for help?
  5. New territory for me entirely. I want to set up some tests on my own site before sending xml to other sites. I believe the method is http post. The first thing I need to do is set up a page on my site to receive xml post and then display it. Later I will be adding it to my db etc but for now I would like to be able to recieve and display. Then I need to have another page to send the data (can't receive anything if I don't send it first right?). Trouble is I don't have a clue where to start. I can't find anything in simple enough language for me to understand. I have some java for sending but not knowing any java I don't know how to implement it and PHP is probably better anyway right? Even a link to the relevant information would be helpful.... my own searches have been fruitless. Thanks.
  6. Bluejay, I was looking at your signature and thinking about 'mine own understanding' and what it is currently lacking! My initial reaction to your mail was... "HUH??????" So I decided to go for a long walk on the beach with my dog. I was thinking about your post and it all became clear! It also clearly became clear to Fenway although I suspect a long walk was not necessary in his case. I just had to apply mysql_real_escape_string() to $initialdescription so that $initialdescription==description in the db! Simple if you know what you're doing I suppose. Thanks guys. Topic solved!
  7. I'd just gone for a long walk on the beach with the dog... and while I was out came up with exactly that. Nice to see it there waiting for me when I got back to confirm my thoughts! topic solved!!!!!!
  8. Sorry, with you now. This is the first problem statement... UPDATE livejobs SET description='<p style=\'text-align:center;\'><span style=\'font-weight:bold;\'> Pharmacy Technician <br /><br /></span>As a part of the dispensary team the technician will assist in the day to day running of the dispensary <br /><br />Reporting To Reporting to Pharmacy Manager / Dispensary Manager <br /><br /><br /><span style=\'font-weight:bold;\'>Key Responsibilities <br /></span><br />Preparing prescriptions <br />O.T.C Sales <br />Customer Service <br />Stock control &amp; ethical ordering <br />Prescription control and paperwork <br />Dispensary house keeping <br />Pro active in personal development <br /><br /><span style=\'font-weight:bold;\'>Knowledge and Experience <br /></span><br />Must hold an approved Pharmacy Technician Qualification <br />Previous O.T.C Sales Experience <br />In-depth product knowledge <br />Ability to deal with high volume dispensing <br />Excellent attention to detail <br /><br /><span style=\'font-weight:bold;\'>Personal Attributes <br /></span><br />Have excellent interpersonal skills <br />Must be highly organised <br />Must be competent and able to work under pressure <br />Customer focused <br />Ability to work in a confidential environment <br />Keen interest in retail Pharmacy <br /><br /></p>' WHERE description='<p style='text-align:center;'><span style='font-weight:bold;'> Pharmacy Technician <br /><br /></span>As a part of the dispensary team the technician will assist in the day to day running of the dispensary <br /><br />Reporting To Reporting to Pharmacy Manager / Dispensary Manager <br /><br /><br /><span style='font-weight:bold;'>Key Responsibilities <br /></span><br />Preparing prescriptions <br />O.T.C Sales <br />Customer Service <br />Stock control &amp; ethical ordering <br />Prescription control and paperwork <br />Dispensary house keeping <br />Pro active in personal development <br /><br /><span style='font-weight:bold;'>Knowledge and Experience <br /></span><br />Must hold an approved Pharmacy Technician Qualification <br />Previous O.T.C Sales Experience <br />In-depth product knowledge <br />Ability to deal with high volume dispensing <br />Excellent attention to detail <br /><br /><span style='font-weight:bold;'>Personal Attributes <br /></span><br />Have excellent interpersonal skills <br />Must be highly organised <br />Must be competent and able to work under pressure <br />Customer focused <br />Ability to work in a confidential environment <br />Keen interest in retail Pharmacy <br /><br /></p>' But a better example of what I'm trying to do is the following job.. SET description='<br />\r\n<p style=\'text-align:center;\'><span style=\'font-weight:bold;\'>Supervising Pharmacist - Letterkenny<br /><br /></span>New opening planned for May 2008.<br />Requires a 3yrs+ pqe.<br />Must be TCD, Australian or New Zealand trained.<br />This Pharmacist will have a keen focus on patient counseling and advice<br />A strong business acumen<br /><br />Flexible hours and a generous renumeration package are on offer to the right Candidate.</p>\r\n<p style=\'text-align:center;\'><span style=\'font-weight:bold;\'>Send your CV in confidence to [email protected] or call 01 201 6363 </span></p>\r\n<p style=\'text-align:center;\'><span style=\'font-weight:bold;\'>\r\n\r\n<span style=\'font-weight:bold;\'>Jackie Brown Medical also recruit for Medical Sales, Social Care, Pharmacy, Allied Health, Medical Admin, Nurses and Doctors</span><span style=\'font-weight:bold;\'>. </span></p>' WHERE description='<p> </p> <p align="center"><strong><span style="text-decoration: underline;">Supervising Pharmacist - Letterkenny<br /><br /></span></strong>New opening planned for May 2008.<br />Requires a 3yrs+ pqe.<br />Must be TCD, Australian or New Zealand trained.<br />This Pharmacist will have a keen focus on patient counseling and advice<br />A strong business acumen<br /><br />Flexible hours and a generous renumeration package are on offer to the right Candidate.</p> <p align="center"><strong><span style="font-size: 10pt; color: windowtext; font-family: 'Verdana','sans-serif';">Send your CV in confidence to [email protected] or call 01 201 6363 </span></strong></p> <p><span style="font-size: 10pt; color: #666666; font-family: 'Verdana','sans-serif';"> <p align="center"> </p> <strong><span style="font-size: 10pt; color: green; font-family: 'Verdana','sans-serif';">Jackie Brown Medical also recruit for Medical Sales, Social Care, Pharmacy, Allied Health, Medical Admin, Nurses and Doctors</span></strong><span style="font-size: 10pt; color: green; font-family: 'Verdana','sans-serif';">. </span></span></p>' Sorry It's a long post.
  9. At the risk of appearing even more inept...... mysql_query("UPDATE livejobs SET description='$description' WHERE description='$initialdescription'") or die(mysql_error()); Is that not it? It's in the while loop.
  10. Code starts $query=mysql_query("SELECT * FROM mytable") or die (mysql_error()); while($result=mysql_fetch_array($query)){ $initialdescription=$result['description']; then there is a bit more code with replaces etc thats all fine. Then I used $description=preg_replace('%(?span[^>]*>)\1+%','$1',$description); Then I have $description=mysql_real_escape($description); Then mysql_query("UPDATE mytable SET description='$description' WHERE description='$initialdescription'") or die(mysql_error()); } It wont work. If I remove WHERE description='$initialdescription' then it runs but it updates all the descriptions to be the same... would have been a disaster if I hadn't backed it up. If I leave it in I get a mysql error because it doesn't seem to like something caused by mysql_real_escape I presume. I'm really in the dark here.... way out of my depth. error is I don't understand it. I'm told there is nothing wrong with the mysql syntax. Any ideas?
  11. That's the relevant source created Fenway. What's the problem with it? I don't get it.
  12. All spans should be the same. I replaced all spans with the ones above (or rather you did! thanks again) and then I replaced all <strong> tags with the same span tags.... thus the double occurance in places. I'll put in the code you just gave me and see what transpires.
  13. I thought the real_escape_string should sort any problems with ' " etc?
  14. I need to change the format of the content of one of my columns across all the rows in the table. I can't get it to work. Here is the code. $query=mysql_query("SELECT * FROM livejobs") or die(mysql_error()); while($result=mysql_fetch_array($query)){ $jobref=$result['jobref']; $jobtitle=$result['jobtitle']; $email=$result['email']; $initialdescription=$result['description'] ; $bad=array("<p> </p>","<strong>","</strong>","<div>","</div>","?"); $good=array("<br />","<span>","</span>","","","ยท"); $description = str_replace($bad,$good,$initialdescription); $description=preg_replace("/<span[^>]+>/", "<span style='font-weight:bold;'>",$description); $description=preg_replace("/<p[^>]+>/","<p style='text-align:center;'>",$description); $description=preg_replace("/<a href=[^>]+>/","<a href='mailto:$email?subject=Re: ".$jobtitle." position. Ref:".$jobref."&body=I am interested in this position and have attached my CV.%0a%0aMy name is:%0aMy Phone Number is:%0a%0aI would like to add the following information:' class='link'>",$description) ; $description=mysql_real_escape_string($description); mysql_query("UPDATE livejobs SET description='$description' WHERE description='$initialdescription'") or die("error in update"); } I tried it without the WHERE bit of the UPDATE statement and it entered the same information into every row. Ouch! Oops! thank God I backed it up first! $description = large job descriptions in html. If anybody can point me in the right direction I'd appreciate it! Ian.
  15. Thanks once again effigy, I don't really follow how real_escape_string() works exactly but work it does. I think I'll post a question in the mysql section. You have been brilliant. I'm going to mark this topic solved (while starting another one about removing a duplicate <span> where they occur together.) Thanks again effigy.
  16. I'm stuck! I need to know how to phrase an expression to get rid of a second span. It goes something like this... <span style='font-weight:bold;'><span style='font-weight:bold;'>some text</span></span> Obviously I only need one span rather than two. It goes $description=preg_replace("what goes here???","",$description); My head is melting!
  17. Thanks again. Not too woried about escaping data since it is an in-house app requiring two passwords to enter it. .... or is there another reason for escaping data other than security?
  18. Helllllppp. How do I send form details to another site in xml format? I have a job site that has it's own db and I can post jobs by using a form to send to my own db.... but now I need to send the details of that form to multiple other sites too. .... and I'm stuck! I have a java solution but I don't understand any of it. .... to the extent that I can't tell what is the address I need to sent to. Here is the code.... var httpOb = new ActiveXObject("Msxml2.XMLHTTP"); if Preview { httpOb.open("POST","AddVPrv_XML.asp", false); } if Upload { httpOb.open("POST","AddV2_XML.asp", false); } var TransactionObj = Transaction.XMLDocument.documentElement; httpOb.send(Transaction.XMLDocument); if(httpOb.status==200) // If successful by the object itself. { alert(httpOb.responseXML.xml); // Alert back the return XML. } Did i mention that i hate javascript (mainly because I haven't learnt it yet). I take it that the code above would give me a preview of what I sent and then upload it and then send me back a response. I have no idea how to implement it though and would far rather use php. All help greatly appreciated! Ian.
  19. Ok, I think I get that. Thank you. Can I put regex expressions into an array like I have with the str_replace? That would get rid of a few lines of code... bearing in mind that I may be adding more things to be replaced... probably will infact. I'm trying to clean up tinyMce output when I send it to my db.
  20. Hi, I am very very new to regex and would like to know how I can clean up the following: $descriptiona = $_REQUEST['description2'] ; $bad=array("<p> </p>","<strong>","</strong>"); $good=array("<br />","",""); $descriptionb = str_replace($bad,$good,$descriptiona); $descriptionc=preg_replace("/<span[^>]*>/", "<span>",$descriptionb); $descriptiond=preg_replace("/<p[^>]*>/","<p>",$descriptionc); $description=preg_replace("/<a href=[^>]*>/","<a href='mailto:$email' class='link'>",$descriptiond) ; Also the last line: $description=preg_replace("/<a href=[^>]*>/","<a href='mailto:$email' class='link'>",$descriptiond) ; seems to be giving me a sql error when I try to insert it into the db. Oh... It may be because I have some temporary echoes in there to show each stage.... echo "a=".$descriptiona."<br />b=".$descriptionb."<br />c=".$descriptionc. etc.
  21. oops... just saw that this post has been moved to the relevant place so ignore my questions.... I'll find it all from here! Thanks again.
  22. That's great. Thanks. What is regex? Is it part of php? Where is a good place to read up on it?
  23. Can I use wildcards in str_replace eg. can $replacing=str_replace("<p style='text-align:center;'>","<p>","$anyoldhtml"); be written as $replacing=str_replace("<p*>","<p>","$anyoldhtml"); ?? I want to reformat a whole load of text from tinyMce that is causing problems with my page validations.... plus there is just too much code created by tinyMce.
  24. Hey, that sounds interesting. Could I use something like it as an alternative to flash? I could create a sequence of images in the db and then call them at an interval of x seconds? Is that possible?
×
×
  • 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.