Jump to content

jbashir

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jbashir's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I want to parse XML coming from this URL: http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=1DN1Y0GF2HTSA76NRQG2&Operation=BrowseNodeLookup&ResponseGroup=BrowseNodeInfo&BrowseNodeId=1000 I want Children->BrowseNode->BrowseNodeId and Children->BrowseNode->Name from this XML. I have tried this code: $url = http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=1DN1Y0GF2HTSA76NRQG2&Operation=BrowseNodeLookup&ResponseGroup=BrowseNodeInfo&BrowseNodeId=1000 $xml = new SimpleXMLElement($url,null,true); foreach($xml as $node) { echo $node->BrowseNode->BrowseNodeId."-". $BrowseNode->BrowseNode->Name; } But I only get this output : 1000 - Subjects (And I do not get further output). Can someone please help me to solve this problem.
  2. Hi adam291086 Again I have gone through the problem and have found that: PHP script creates user folder with 0777 privileges. Here is the code: $filepath = $CONFIG['userpics'] . (USER_ID + FIRST_USER_CAT); $dest_dir = $CONFIG['fullpath'] . $filepath; if (!is_dir($dest_dir)) { // the dir is created with 0777 privileges mkdir($dest_dir, octdec($CONFIG['default_dir_mode'])); if (!is_dir($dest_dir)) cpg_die(CRITICAL_ERROR, sprintf($lang_db_input_php['err_mkdir'], $dest_dir), __FILE__, __LINE__, true); Even though the dir has 0777 permissions still the rename($path_to_image, $uploaded_pic) function cannot move the file to destination dir. In this case not even the move_uploaded_file ( string $filename , string $destination ) function works. On the other hand, when I create the folder manually via FTP Client with 0777 permissions everything goes well. In both cases (folder created by php script, and folder created manually through FTP Client), the folder has 0777 permissions, but in the first case it does not work while in the second it works. Can you please help to figureout what could be the problem here? Thanks
  3. I have seen the admin section and also have seen the database. Everything for "joe" is same as "joseph".
  4. I have tried this before, i.e., different files for both users, and there is no destination file as well before renaming.
  5. I also posted this code in my first post. // Create path for final location. $uploaded_pic = $dest_dir . $picture_name; // Form path to temporary image. $path_to_image = './'.$CONFIG['fullpath'].'edit/'.$file_set[1]; // prevent moving the edit directory... if (is_dir($path_to_image)) cpg_die(CRITICAL_ERROR, $lang_upload_php['failure'] . " - '$path_to_image'", __FILE__, __LINE__, true); echo "path to imnage: ".$path_to_image; echo "uploaded pic: ".$uploaded_pic; echo "entreing rename function"; /* same results are echo(ed) for both user till here. But below this only "joseph" can enter successfully, not "joe"*/ //Move the picture into its final location if (rename($path_to_image, $uploaded_pic)) { echo "in rename"; exit; Everything goes same for both users just before rename() function. Then for user "joseph" the file/dir is renamed but for user "joe" it is not. Rather it goes to the else part of the if statement and displays the error "File could not be placed successfully."
  6. Thanks, you are right. But my problem is that I am using a ready-made module and do not want to change the code. Plus, the code is working fine for the other two users but hinders the third user to upload the files while all users have the same privileges. And the problem, as I mentioned in my first post, occurs at the rename() function.
  7. I have not written this function my self. Its php function. Here it is: rename($path_to_image, $uploaded_pic)
  8. I posted this problem today morning but still there is no reply from someone. Here is some more about the problem. I am using Coppermine Photo Gallery (a php module) http://coppermine-gallery.net/ for uploading and managing images. The problem is occuring in upload.php file. If someone has used this module and can take some time to look into the problem. Your help will be much appreciated. Thanks
  9. I am facing uploading problem in php script. I have two users: 1. joseph 2. joe Both users have the same privileges and can upload the images. The problem I am facing is, that user "joseph" can upload the images while "joe" can not. I have gone through the script line by line and have echo(d) the results line by line for both users and have seen that the problem occurs at the rename($path_to_image, $uploaded_pic) function. For "joseph" the file/dir is renamed but for "joe" it does not. Again I say that both the users are registered users and have the same privileges. Can someone please help me? Here is the code: // Create path for final location. $uploaded_pic = $dest_dir . $picture_name; // Form path to temporary image. $path_to_image = './'.$CONFIG['fullpath'].'edit/'.$file_set[1]; // prevent moving the edit directory... if (is_dir($path_to_image)) cpg_die(CRITICAL_ERROR, $lang_upload_php['failure'] . " - '$path_to_image'", __FILE__, __LINE__, true); echo "path to imnage: ".$path_to_image; echo "uploaded pic: ".$uploaded_pic; echo "entreing rename function"; /* same results are echo(ed) for both user till here. But below this only "joseph" can enter successfully, not "joe"*/ //Move the picture into its final location if (rename($path_to_image, $uploaded_pic)) { echo "in rename"; exit; Thanks Joseph Bashir Ufnasoft http://ufnasoft.com
  10. I am getting these warnings. Can someone please help me how I can solve these problems? Warning: session_start() [function.session-start]: open(../../sess_e6c892857130433aebff3c32122517b1, O_RDWR) failed: No such file or directory (2) in /../session.inc on line 28 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /../session.inc:28) in /../session.inc on line 28
  11. Is it possible to redirect page1 to page2 while showing the same page1 url in the address bar? e.g.: I want to redirect http://mysitec.com/ to http://mysite.com/test/. I want the page to be redirected to http://mysite.com/test/ but the browser should display http://mysite.com/ only in the address bar. Any idea? Thanks
  12. Liam I have used your code but still the same results. I have also remove @ symbol as 'wildteen88' has just told, but still it is not showing any results, not even errors. All am getting is in the access.log file (Apache2.2/logs/access.log) is: 192.168.0.21 - - [26/Aug/2006:19:30:26 +0500] "GET /test.php HTTP/1.1" 200 -
  13. Liam In the start I was doing it the you are telling: $dbhost = 'localhost'; and I had this problem. And then someone suggested it this way (as now): $dbhost = 'localhost:3306'; and still there is the same problem. Joseph
  14. I am having problem in making database connection with mysql database. I have searched the web and my code looks exactly the same as many have written. But still there is no success. Can someone look into it and guide me where I am wrong. Here is the code: $dbhost = 'localhost:3306'; $dbuser = 'testuser'; $dbpass = 'testpass'; $conn = @mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql' . mysql_error()); $dbname = 'testdb'; mysql_select_db($dbname); I am using Apache 2.2.
×
×
  • 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.