Jump to content

mjs87

Members
  • Posts

    15
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

mjs87's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Great thanks for your help... I'm starting to get a better understanding of regex
  2. That works thank you. Just for my understanding what does the / before the [ do and the /s after the ]? I’ve read the link but can’t work out what these two things are doing? Thank for your help
  3. if(preg_match('[\>]', $this->Results->Text)) return “Error – Results contains invalid characters”; Unfortunately it’s for another reason, so my only option is to use preg_match. I have tried the above which seems to detect the > character. However I don’t understand why /> needs to be enclosed in the square brackets because the square brackets mean a range? Also I’m not too sure how to go on and detect the – and < characters? Thanks
  4. Hi I'm trying to use preg_match to stop the <, - and > characters from being input in a text field. I have read that the < and > characters have to be escaped e.g. /< and /> however \< and \> are anchors in regex? If anyone can help i'd really appreciate it, thanks in advance!
  5. Hi I am trying to select the document titles stored in a database. However I only want to select the title for a document that belongs to the user that is logged in, furthermore the user (teacher) teaches a maximum of 2 subject I therefore am only selecting documents that belong to subject 1. The problem I am having is that the results are displayed twice. Here are my tables: The Select statement: $uname = $_SESSION['uname']; $sSQLDoc="SELECT tblPlan.docname, tblPlan.doctitle, tblPlan.datecreated, tblPlan.datemodified, tblPlan.modifiedby FROM tblPlan INNER JOIN tblSubjectUser ON tblPlan.subject = tblSubjectUser.subject WHERE (((tblPlan.uname)='$uname') AND ((tblSubjectUser.subjectnum)='1'))"; $rsDoc = mysql_query($sSQLDoc);
  6. mjs87

    XSL Total variable

    Hi, I am fairly new to XML/XSL. I am trying to sum a variable that is within a for-each loop. The $subtotal variable is working out the total price for each product ordered on a invoice. Once all the products have been output I need to calculate the overall total price. I have tried to create a variable and increment it on each loop but you cannot change a variable once it has been set from what I have read. below just shows where I have just tried to sum the $subtotal variable...any ideas would be appreciated...thanks in advance <xsl:for-each select="DeliveryDetails/ProductOrder"> <tr align="center"> <td width="150"><xsl:value-of select="Description" /></td> <td width="150"><xsl:value-of select="ReferenceNo" /></td> <td width="100"><xsl:value-of select="Quantity" /></td> <td width="100">£<xsl:value-of select="Price" /></td> <td width="100">£ <xsl:variable name="subtotal" select="Quantity*Price" /><xsl:value-of select="$subtotal" /></td> </tr> </xsl:for-each> <xsl:value-of select="sum($subtotal)"/>
  7. Hi I have installed PHP 5 from the non-safe-thread zip package from php.net/downloads.php which is working fine with my php files. However I need my php script to work with xml and xslt hence I need the xslt processor. I have read around this and basically everywhere says it is included in php 5 and that I just need to uncomment ;extension=php_xsl.dll which I have done...however when I restarted the server and ran my <?php phpinfo() ?> page XSLT was still not showing up although the XML libaries were. Could someone push me in the right direction here? thanks!
  8. ok cheers for all the help and advice.
  9. I am using a web host to test the program so will they have to install this?
  10. Thanks for the reply, which makes sense to me, I was looking at simpleXml and it seemed quite complicated. However with your solution I get the following error Thanks for the help
  11. Basically I am trying to transform an XML document with XSL on the server. I have looked long and hard at how to do it in PHP and it seems quite complicated, however I have found the following ASP script that works and it seems pretty simple: <% 'Load XML set xml = Server.CreateObject("Microsoft.XMLDOM") xml.async = false xml.load(Server.MapPath("document.xml")) 'Load XSL set xsl = Server.CreateObject("Microsoft.XMLDOM") xsl.async = false xsl.load(Server.MapPath("planstyle.xsl")) 'Transform file Response.Write(xml.transformNode(xsl)) %> The only problem is that I need the transformation to be done in PHP, so could anyone point me in the right direction on how I could get a simple script like the above in php. Many Thanks
  12. Basically I am trying to transform an XML document with XSL on the server. I have looked long and hard at how to do it in PHP and it seems quite complicated, however I have found the following ASP script that works and it seems pretty simple: <% 'Load XML set xml = Server.CreateObject("Microsoft.XMLDOM") xml.async = false xml.load(Server.MapPath("document.xml")) 'Load XSL set xsl = Server.CreateObject("Microsoft.XMLDOM") xsl.async = false xsl.load(Server.MapPath("planstyle.xsl")) 'Transform file Response.Write(xml.transformNode(xsl)) %> The only problem is that I need the transformation to be done in PHP, so could anyone point me in the right direction on how I could get a simple script like the above in php. Many Thanks
  13. Could someone point me in the right direction where I could find a decent tutorial? thanks
  14. useful, I never knew PHP had odbc functions, I always thought it was limited in that respect and had to use mysql. I just need to find the tutorial i was working from again because I didn't think I would be able to use it. I am quite a newbie to this so I will most likely be writing back for more help! thanks in the meantime!!
  15. Hi I am fairly new to Ajax and have been searching for a autosuggest search tutorial that uses suggestions from a field in an MS Access database. I have found a few tutorials using mysql, however these tutorials use the mysql functions with php and I am not able to tailor this towards my MS Access DB. Could someone point me in the right direction of a simple way to produce a Ajax search field that autosuggests using a field in a MS Access db. 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.