Jump to content

bdee1

Members
  • Posts

    41
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

bdee1's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. no it is smartermail Pro 5.5 http://www.smartertools.com/
  2. i am running a php 5 server on windows serrver 2003/IIS and i am having trouble getting the mail function to work in my PHP scripts. I just want to be able to do simple contact forms from my PHP scripts. every time i try to send an email from a php script, it does not give an error - it appears as though it sends but the mail is never actually received. i modified my php.ini file and set the following: [mail function] ; For Win32 only. SMTP = IP_Address_of_My_Mail_Server ; for Win32 only smtp_port = 25 sendmail_from= mail@mydomain.com ; for Win32 only how can I get this to work??
  3. Hi - I am trying to use simpleXML to parse a picasaWeb XML feed and I am running into a bit of trouble. the URL of the picasaweb feed I am using is: http://picasaweb.google.com/data/feed/api/user/blairdee2000/albumid/5149975922288869729?kind=photo&access=public&thumbsize=144c&imgmax=512 right now i am just trying to spit out the thumbnail image url and the title and description for each. so the thumbnail url should be at: feed->entry->media:group->media:thumbnail in the url attribute and the title should be found at feed->entry->media:group->media:title and the description should be found at feed->entry->media:group->media:description so initially i thought the following code would work: $xml = simplexml_load_file($feedURL); foreach($xml->entry as $entry) { imgTitle = entry->media:group->media:title; imgDescrip = entry->media:group->media:description; thumbURL = entry->media:group->media:thumbnail['url']; echo("<strong>Title:" . $imgTitle . "</strong><br/>"); echo("<strong>Description:" . $imgDescrip . "</strong><br/>"); echo("<img src='" . $thumbURL . "'><br/>"); } but that didnt work - it seems as though the : in the node names is throwing it off. sorry I am a relative newbie - i am sure that the colon has a special meaning but i dont know what it is. so i ended up finding some code that does work but it seems more complex than it needs to be: $xml = simplexml_load_file($feedURL); foreach($xml->entry as $entry) { $imgTitleArray = $entry->xpath('./media:group/media:title'); $imgTitle = $imgTitleArray[0]; $imgDescripArray = $entry->xpath('./media:group/media:description'); $imgDescrip = $imgDescripArray[0]; $imgThumbArray = $entry->xpath('./media:group/media:thumbnail'); $imgThumbAttributes = $imgThumbArray[0]->attributes(); $imgThumb = $imgThumbAttributes[0]; echo("<strong>Title:" . $imgTitle . "</strong><br/>"); echo("<strong>Description:" . $imgDescrip . "</strong><br/>"); echo("<img src='" . $imgThumb . "'><br/><br/>"); } looks like i have to use the xpath function to reference these special nodes which returns an array. then i have to use the attributes function to return an array of the attributes. then i have to reference the attributes array item by its numerical index... i dunno this seems more complex than it needs to be... am I right? or is that just how it has to be done. if someone could provide some guidance to get me in the right track here I would appreciate it.
  4. hey thanks for the reply but i am not sure i am able to follow your code snippet any chance you could explain it a bit further?
  5. i have a 2 dimensional array which is basically an array where each element contains an associative array. one of the keys of the associative array is id which contains a numeric value. how woudl i go about sorting the root array in the order of the id element from the associative arrays?
  6. nevermind - it was way simpler than i thought. #CREATING THE HANDLER $xml = simplexml_load_file(SITEROOT.'/data/file.xml'); #loop through the LinkGroups to find the one we're looking for foreach($xml->linkCollection->linkGroup as $linkGroup) { if ($linkGroup['id'] == $passed_groupID) { $linkGroup['title'] = $passed_title; break; } } #WRITE THE RESULTS BACK TO THE XML FILE file_put_contents(SITEROOT.'/data/file.xml', $xml->asXml());
  7. i am using simpleXML to parse and update the contents of an xml file based on user input. my xml structure looks liek this: <linkCollection> <linkGroup id="1" title="Photoshop"> <linkItem id="2"> <title></title> <description></description> <url></url> </linkItem> <linkItem id="4"> <title></title> <description></description> <url></url> </linkItem> </linkGroup> </linkCollection> i want the user to be able to edit the title attribute of the linkGroup node. i know that i could drop the node and then rebuild it with the updated values but since the linkGroup node could have many children, it woudl be nice if i coudl just update the title attribute and then save the file. how could i go about doing that?
  8. sorry abotu the over quoting - i will be sure to keep that in mind in the future. and yes I am usign IIS because i also host sites which use coldfusion and IIS. plus i use Helm control panel which uses IIS.
  9. Could that be causing the issue? Other than that, I am not sure how IIS really works and maybe it changes scopes of stuff, I dunno. I would make it a constant anyways, just makes everything that much easier. yea that was it - i was tryign to access it from inside a function... made it a constant and now it seems to work... thanks!!
  10. ok that sounds like an incredible pain, so... i was thinking that i could just add something like $siteRoot = "C:\inetpub\websites\sitename" to a common.php file. and then just include common.php in every page. i was already including common.php in every page for another reason so i thought this woudl be easy. well the line i am having problems with (the one opening the xml file) in in siteroot\includes\functions.php. and functions.php could be called from any page anywhere in the site. si i will have a problem is i have to include common.php in functions.php. so i was thinking i could just include common.php in any page the includes functions.php (as long as in included common.php before i include functions.php. but for some reason when i try that, it says Undefined variable: siteRoot in C:\...\functions.php wouldnt functions.php be able to grab the $siteRoot variable from the include of common.php on the calling page (siteroot\index.php)?? For IIS it is probably a pain, for Apache it is actually really really simple and totally worth it for not having to change the server configuration file anytime you want to change servers. I think your logic is not seeing the total picture. I could just be gathering the wrong conclusion out of this, so here is what I think you are trying to figure out: You have multiple sites on your box. You want to be able to switch from siteA which is located at c:\wwwroot\siteA to siteB which is located at c:\wwwroot\siteB without having to modify the configuration file and change the document root each time. Right? If that is right, then doing that in commons.php will not help you, unless each page of your script goes and calls that identical page for siteB and includes it. Due to the simple fact that siteA files are probably not the same as siteB files. Unless SiteA is just a mirror of siteB, in which case your logic may work. If that is not the case, sorry man, but the work around is not that simple. If my impression was wrong, totally disregard everything I posted. To include something no matter what the path is, $_SERVER['DOCUMENT_ROOT'] is the key, just remember you still have to define /path/after/root/to/file to get it to include right. As for the $siteRoot not being defined, are you sure you are including the new version of the commons.php? EDIT: Are you also sure you are not trying to use $siteRoot inside a function or class? If you plan to do that you need to use define and make SITEROOT a constant to have a global scope. yea i think you misunderstood... i would LIKE to have it set up so that i could use $_SERVER['DOCUMENT_ROOT'] regardless of what site i am on (i host several) on my server. but once i realized what a pain that woudl be on IIS, i changed my approach. i figured that by defining $siteRoot in the common.php file and then including that common.php file in ever file in my site, that might work... then for each site i would just have to have a common.php file which defines the $siteRoot for that site.
  11. ok so i can tell for sure that both common.php and functions.php are being included (in that order)... so why cant functions.php see the $siteroot variable defined in common.php??
  12. ok that sounds like an incredible pain, so... i was thinking that i could just add something like $siteRoot = "C:\inetpub\websites\sitename" to a common.php file. and then just include common.php in every page. i was already including common.php in every page for another reason so i thought this woudl be easy. well the line i am having problems with (the one opening the xml file) in in siteroot\includes\functions.php. and functions.php could be called from any page anywhere in the site. si i will have a problem is i have to include common.php in functions.php. so i was thinking i could just include common.php in any page the includes functions.php (as long as in included common.php before i include functions.php. but for some reason when i try that, it says Undefined variable: siteRoot in C:\...\functions.php wouldnt functions.php be able to grab the $siteRoot variable from the include of common.php on the calling page (siteroot\index.php)??
  13. yes i am using IIS.... so assuming that ll my domains are in C:\inetpub\websites\sitename... what do i need to set doc_root to? i need php to function for several websites on my server - not just this one.
  14. ok i still dont follow... why am i getting... Undefined index: DOCUMENT_ROOT in C:\...\functions.php on line 168
  15. Yes. Use an absolute path starting at $_SERVER['DOCUMENT_ROOT']. thanks for the reply... i am not clear on what that does so i tried to echo it from the main page and i get the following: Undefined index: DOCUMENT_ROOT in C:\domains\blairdee.info\wwwroot\PHP\index.php on line 53
×
×
  • 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.