Jump to content


Photo

passing url variable and mkdir


  • Please log in to reply
2 replies to this topic

#1 beermaker74

beermaker74
  • Members
  • PipPipPip
  • Advanced Member
  • 35 posts

Posted 19 October 2006 - 02:44 AM

ok i have a multi part problem. first off I have a insert record page where a user inserts user name, pass ,and a bunch of other info. that info is inserted into table A. then it takes them to the redirect page. Here is where all the questions start. What I want to do is have a url id passed so i can have access to all the data from table A. On page 2 I have another insert record behavior where i am inserting info about photos into table b. I want table b to be passed the id from the previous page so i can keep track of what photos go with what record. I have a hidden field that would insert this if i could get the url id passed. I am allowing users to upload photos and write descriptions about the photos on the second page. I also want a new folder created in the photo upload dir that is named from the data in table a. ie username and id. so what i was thinking was to pass the url id. then use a recordset to insert the information dynamically. i was using the mkdir command here is my code
<?php
mkdir("/home/immersiv/public_html/holland/admin/$row_Recordset1['id']", 0777);
?>
here is the error i get when i try this

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/immersiv/public_html/holland/admin/edit.php on line 209

if i take out the variable and insert a regular name it works fine. ie
mkdir("/home/immersiv/public_html/holland/admin/newtestdir", 0777);

i am  using sephiroth php upload dreamweaver extension to allow users to upload photos. So i want to dynamically assign the folder upload path to the same one that was just created with mkdir. ie
define("DESTINATION_FOLDER", "/home/immersiv/public_html/$row_Recordset1['id']/"); am i going to have the same problem that i am having with the mkdir function?

If i am going about this totally wrong then please let me know. Do I just need to declare a variable above the mkdir script?
thanks

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 19 October 2006 - 02:47 AM

<?php
mkdir("/home/immersiv/public_html/holland/admin/".$row_Recordset1['id']." ", 0777);
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#3 beermaker74

beermaker74
  • Members
  • PipPipPip
  • Advanced Member
  • 35 posts

Posted 19 October 2006 - 08:53 PM

thanks  thats works but i still cant pass the variable. plus when i create the folder it wont let me delete it. I have tried using umask and creating the folder thru ftp but the results are the same. no permissions and chmod to 755 when it should be 777
thanks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users