Jump to content

thetwig

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

thetwig's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hey robert, thanks for the tips... but I'm really confused as to what you are doing.. is there any way i can avoid using php? but if php is the only way to do it, then can you explain the code, esp the actual emailing part.. "mailto($to...)" thnx agen... and sorry for the noobage..
  2. Hey guys, when I do a normal mailto button, it works fine, but I have to use a form if I want to display a thank you/your message has been received page..... right? So once I do this, the subject and the body doesnt appear the way I want it to... only the can anyone tell me what I'm doin wrong? <form action="mailto:karama@gmail.com?Subject=Request%20for%20Action&body=Name:%0D%0AUnit:%0D%0APhone:%0D%0A%0D%0ARequest%20for%20Action:%0D%0A" onsubmit="actionTq.html"> <input type="submit" value="Request for Action" /><br /><br /> </form>
  3. DUDE!!! ZUREV! ur a freakin genius!... the coding didnt work... but i manually did it from my ftp.... it works fine now!!! WOO!! thnx a heap.... seriously man... appreciate it!! THANKS!
  4. hey Zurev.. I came up with this error: Parse error: syntax error, unexpected T_LNUMBER in /www/zymichost.com/i/n/d/inderasubangcondo/htdocs/newYrRegTq.php on line 14 I tried putting that line in, and since I don't really understand it I tried 4 combinations of what I thought it could be changing the .cgi to .txt and the 755 to 777.. 1. Telnet/cgi-bin>chmod 755 newYearParty.cgi 2. Telnet/cgi-bin>chmod 777 newYearParty.cgi 3. Telnet/cgi-bin>chmod 755 newYearParty.txt 4. Telnet/cgi-bin>chmod 777 newYearParty.txt All four didn't work... here's where i put it.. (line 14) <?php $nam = $_POST["nam"]; $block = $_POST["block"]; $floor = $_POST["floor"]; $house = $_POST["house"]; $adults = $_POST["adults"]; $children = $_POST["children"]; $guests = $_POST["guests"]; Telnet/cgi-bin>chmod 777 newYearParty.cgi //I PUT IT HERE //set id and update total numbers $fn = fopen("newYearParty.txt","a+"); $line1 = fgets($fn); $arr1 = explode(": ", $line1); //adults $line2 = fgets($fn); $arr2 = explode(": ", $line2); //children $line3 = fgets($fn); $arr3 = explode(": ", $line3); //guests $line4 = fgets($fn); $arr4 = explode(": ", $line4); //total $line4 = fgets($fn); //blank line $numAdults = $arr1[1]+$adults; $numChildren = $arr2[1]+$children; $numGuests = $arr3[1]+$guests; $numTotal = $numAdults+$numChildren+$numGuests; $id = "nothing"; while(!feof($fn)) { $line = fgets($fn); //id $arr = explode(": ", $line); $id = $arr[1] + 1; //get latest id and add 1 to it for($i=0; $i<6; $i++) { $line = fgets($fn); } } fclose($fn); if($id == "nothing") { $id = "0"; } //end of set id //write to file $line0 = "\r\nId: ".$id."\r\n"; $line1 = "Name: ".$nam."\r\n"; $line2 = "Unit: ".$block."-".$floor."-".$house."\r\n"; $line3 = "Adults: ".$adults."\r\n"; $line4 = "Children: ".$children."\r\n"; $line5 = "Guests: ".$guests."\r\n"; $fn = fopen("newYearParty.txt","a+"); fwrite($fn, $line0); fwrite($fn, $line1); fwrite($fn, $line2); fwrite($fn, $line3); fwrite($fn, $line4); fwrite($fn, $line5); fclose($fn); //end of write to file //write new numbers to file $ft = fopen("newYearPartyTemp.txt","a+"); $lineA = "Adults: ".$numAdults."\r\n"; $lineC = "Children: ".$numChildren."\r\n"; $lineG = "Guests: ".$numGuests."\r\n"; $lineT = "Total: ".$numTotal."\r\n\r\n"; fwrite($ft, $lineA); fwrite($ft, $lineC); fwrite($ft, $lineG); fwrite($ft, $lineT); $fn = fopen("newYearParty.txt","a+"); for($i=0; $i<5; $i++) { $line = fgets($fn); } while(!feof($fn)) { $line = fgets($fn); fwrite($ft, $line); } fclose($fn); fclose($ft); unlink("newYearParty.txt"); //delete newYearParty.txt rename("newYearPartyTemp.txt","newYearParty.txt"); //rename newYearPartyTemp.txt to newYearParty.txt //end of write new numbers to file ?> Let me know what I'm doing wrong. Thanks for your help.
  5. So is there any way I can get permission? And why do I need permission to write to a file? Thanks a heap.
  6. Hi guys, I'm doing a website for the condo and I'm having troubles with the new year party registration form. I think it's got something to do with my file handling. When I run it on my wamp server, it works fine. But when I upload it onto the internet it gives me a whole bunch of warnings: Warning: fopen(newYearParty.txt) [function.fopen]: failed to open stream: Permission denied in /www/zymichost.com/i/n/d/inderasubangcondo/htdocs/newYrRegTq.php on line 18 Warning: fgets(): supplied argument is not a valid stream resource in /www/zymichost.com/i/n/d/inderasubangcondo/htdocs/newYrRegTq.php on line 19 Warning: fgets(): supplied argument is not a valid stream resource in /www/zymichost.com/i/n/d/inderasubangcondo/htdocs/newYrRegTq.php on line 20 Heres my code: <?php $nam = $_POST["nam"]; $block = $_POST["block"]; $floor = $_POST["floor"]; $house = $_POST["house"]; $adults = $_POST["adults"]; $children = $_POST["children"]; $guests = $_POST["guests"]; $nam = $_POST["nam"]; global $fn, $ft; //set id and update total numbers $fn = fopen("newYearParty.txt","a+"); $line1 = fgets($fn); $arr1 = explode(": ", $line1); //adults $line2 = fgets($fn); $arr2 = explode(": ", $line2); //children $line3 = fgets($fn); $arr3 = explode(": ", $line3); //guests $line4 = fgets($fn); $arr4 = explode(": ", $line4); //total $line4 = fgets($fn); //blank line $numAdults = $arr1[1]+$adults; $numChildren = $arr2[1]+$children; $numGuests = $arr3[1]+$guests; $numTotal = $numAdults+$numChildren+$numGuests; $id = "nothing"; while(!feof($fn)) { $line = fgets($fn); //id $arr = explode(": ", $line); $id = $arr[1] + 1; //get latest id and add 1 to it for($i=0; $i<6; $i++) { $line = fgets($fn); } } fclose($fn); if($id == "nothing") { $id = "0"; } //end of set id //write to file $line0 = "\r\nId: ".$id."\r\n"; $line1 = "Name: ".$nam."\r\n"; $line2 = "Unit: ".$block."-".$floor."-".$house."\r\n"; $line3 = "Adults: ".$adults."\r\n"; $line4 = "Children: ".$children."\r\n"; $line5 = "Guests: ".$guests."\r\n"; $fn = fopen("newYearParty.txt","a+"); fwrite($fn, $line0); fwrite($fn, $line1); fwrite($fn, $line2); fwrite($fn, $line3); fwrite($fn, $line4); fwrite($fn, $line5); fclose($fn); //end of write to file //write new numbers to file $ft = fopen("newYearPartyTemp.txt","a+"); $lineA = "Adults: ".$numAdults."\r\n"; $lineC = "Children: ".$numChildren."\r\n"; $lineG = "Guests: ".$numGuests."\r\n"; $lineT = "Total: ".$numTotal."\r\n\r\n"; fwrite($ft, $lineA); fwrite($ft, $lineC); fwrite($ft, $lineG); fwrite($ft, $lineT); $fn = fopen("newYearParty.txt","a+"); for($i=0; $i<5; $i++) { $line = fgets($fn); } while(!feof($fn)) { $line = fgets($fn); fwrite($ft, $line); } fclose($fn); fclose($ft); unlink("newYearParty.txt"); //delete newYearParty.txt rename("newYearPartyTemp.txt","newYearParty.txt"); //rename newYearPartyTemp.txt to newYearParty.txt //end of write new numbers to file ?> Any ideas on how to fix this up? Thanks a lot in advance.
×
×
  • 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.