-
Posts
84 -
Joined
-
Last visited
ScrewLooseSalad's Achievements

Member (2/5)
0
Reputation
-
bash script not writing variables to file
ScrewLooseSalad replied to ScrewLooseSalad's topic in Other Programming Languages
Oh, of course, thankyou trq -
I've written a basic bash script to test SSMTP, SSMTP works fine, but the script I wrote doesn't send the message correctly clear echo "sending mail" echo "who are you sending it to?" read $to echo echo "excellent, now what is the subject?" read $subject echo echo "marvelous, now write a quick message:" read $message echo To: $to > mail.txt echo From: emailbox >> mail.txt echo Subject: .$subject >> mail.txt echo $message >> mail.txt clear echo "ok, I will send this message for you..." ssmtp $to < mail.txt echo "message sent successfully!" thsi just creates the file without the variables in it for some reason can anyone spot where I've gone wrong? thanks
-
variables between multiple functions
ScrewLooseSalad replied to ScrewLooseSalad's topic in Applications
Oh yeah, I forgot about that, I might well end up using $_SESSION; It doesn't matter, I'm only using functions to break down a large task I'm having difficulty getting my head around -
I wrote a long explaination, but then the page was refreshed an I lost it... essentially I can't get variables to work between functions, resorted to globals, I can get away with it, but I can't even get that to worl... code: <?php global $checkvar; //get the 'checkvar' this is an array of strings $checkvar = $_GET['checkvar']; checkvariable(); function checkvariable() { var_dump($checkvar); } ?> the dump of $checkvar comes up NULL in the function, but fine right after its been called.
-
I need to increase the session length for my app, it keeps timing out on the people using it.. just changing the default in my php settings would be great but I haven't found anything that's worked for me on-line, is anyone able to help?
-
undefined variable - that isn't mentioned anywhere
ScrewLooseSalad replied to ScrewLooseSalad's topic in Applications
thankyou for pointing that out- 3 replies
-
- php
- undefined variable
-
(and 2 more)
Tagged with:
-
undefined variable - that isn't mentioned anywhere
ScrewLooseSalad replied to ScrewLooseSalad's topic in Applications
UPDATE ----------- Now every variable on every page of the site is an undefined variable :S this is a serious problem for me, as this app is currently being used... SECOND UPDATE ----------------------- Started working again, it seems the loop must have had an effect on the server.... I had to reboot the system- 3 replies
-
- php
- undefined variable
-
(and 2 more)
Tagged with:
-
I've narrowed down my problem to this function... The page won't load, I suspected it was because it was stuck in a loop, but I couldn't see why, checking the error log confirmed this, as there were hundreds of errors for an undeclared variable.... I can't figure out why it is stuck in this loop, and I can't get the undeclared variable to go away, I even renamed it and it is still saying the old name of the variable is undeclared even though it isn't mentioned in the code anywhere I've renamed it.... Can anyone spot what is causing me grief? The only thing that would make sense would be if I wasn't updating the files when I uploaded them, but I am completely certain that I am... error log: code: while ($i<=14) { if($replacement_company_PartNo[$i] = NULL) { //this isn't an item from the database, simply print the description $replacement_Description //write details to new delivery note via 'delnoteitems' $sql = "INSERT INTO `companyorders`.`delnoteitems`(`deliverNote`, `itemDesc`, `itemQuantity`, `itemNotes`, `company_PartNo`) VALUES ('$deliverNote', '$replacement_Part_Name[$i]', '$replacement_Quantity[$i]', '$replacement_Description[$i]', '$replacement_company_PartNo[$i]');" ; $result = mysql_query($sql); if(!$result) {echo "$sql<br>sql error! code: DL4-A031-$i. This isn't an item from the database, skipping write to 'fullnotestock'; however, 'delnoteitems' could not be written to. Round $i."; exit;} } else { //this is an item from the database, the stock listings must be updated as the item is listed onto the delivery note //write details to new delivery note via 'delnoteitems' $sql = "INSERT INTO `companyorders`.`delnoteitems`(`deliverNote`, `itemDesc`, `itemQuantity`, `itemNotes`, `company_PartNo`) VALUES ('$deliverNote', '$replacement_Part_Name[$i]', '$replacement_Quantity[$i]', '$replacement_Description[$i]', '$replacement_company_PartNo[$i]');" ; $result = mysql_query($sql); if(!$result) {echo "$sql<br>sql error! code: DL4-A032-$i. This is an item from the database, havent yet attempted to write to 'fullnotestock'; failed on 'delnoteitems' which could not be written to. Round $i."; exit;} //update the stock listing in 'fullstocklist' $sql = "UPDATE `fullstocklist` SET `Stock`='$stockfromdatabase[$i]' WHERE `company_PartNo`='$replacement_company_PartNo[$i]';" ; $result = mysql_query($sql); if(!$result) {echo "$sql<br>sql error! code: DL4-A033-$i. This is an item from the database, havent yet attempted to write to 'fullnotestock'; failed on 'delnoteitems' which could not be written to. Round $i."; exit;} } $i++; }
- 3 replies
-
- php
- undefined variable
-
(and 2 more)
Tagged with:
-
filling in a form from jquery autocomplete
ScrewLooseSalad replied to ScrewLooseSalad's topic in Javascript Help
I want to click the clients name, then have the address and phone numbers filled in, in the other inputs of the form- 3 replies
-
- jquery
- autocomplete
-
(and 1 more)
Tagged with:
-
I have a form with elements of the jquery autocomplete, it is possible to look up clients this way. however, I'd like other form elements below such as address or telephone number to be filled in automatically when a client is selected. Is this possible with jquery? I can't seem to find anything documenting it.. Thanks
- 3 replies
-
- jquery
- autocomplete
-
(and 1 more)
Tagged with: