Jump to content

curtis_b

Members
  • Posts

    48
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

curtis_b's Achievements

Member

Member (2/5)

0

Reputation

  1. well, this failed: include_once ('classes/config.php'); the syntax is correct, but the path provided is not. It looks like you are trying to include: /home/public_html/payment/classes/config.php Does that file exist?
  2. 1) I don't have a php environment handy, so this is completely untested. 2) Assuming the number of element in $ship_methods_allowed is unpredictable, I would try something like this: $eval_string = "$result = array_intersect("; for( $i = 0; $i < count( $ship_methods_allowed ); $i++ ) { $eval_string .= "$ship_methods_allowed[" . $i . "], "; } //trim off last ", " $eval_string = substr($eval_string, 0, -2); $eval_string .= ");"; eval($eval_string); //now you should have a $result variable containing the intersection 3) Your var_dump() contradicted your explanation of what $shipping_methods_allowed contains. You should see everything in var_dump() that you expect to be in the array.
  3. this won't solve your problem, but try making it one query: SELECT * FROM people, usergroups WHERE usersgroups.userid = people.id AND groupid = '$g'
  4. what does $ship_methods contain (what does a var_dump($ship_methods) produce) and what do you want $result to contain?
  5. try adding the database name and putting the date in quotes. Varchars need quotes. INSERT INTO databasename.users timelogged VALUES '08-30-07' WHERE username = 'abarter'
  6. I'm not sure if I understand your question, why would you need to do it differently? Absolutely, if you program the script to generate a unique filename (like using the current timestamp as the filename). As for logging all submissions in one file, yeah you could routinely append one text file, but at that point I would say just use a database.
  7. oh also, chmod assumes you're on a linux/unix server. If you're using a windows server, well, I don't know about windows permissions, but I imagine it's the same concept... you need to open up the write permissions.
  8. chmod is how you change file/directory permissions. you can change it either through your FTP client or in a terminal/shell if you have access to the server. google chmod. In filezilla (my ftp client) I would select the directory on the server, right-click it, and select 'file attributes'. 777 is full access, that allows the php script to be able to create/overwrite files in the same directory.
  9. and now for a much more useful answer: This is one way to create a comma seperated paragraph in a text file. <html><form action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST"> <input type="checkbox" name="food">food<br> <input type="checkbox" name="boxes">boxes<br> <input type="checkbox" name="computers">computers<br> <input type="checkbox" name="racecars">racecars<br> <input type="submit" value="generate file"> </form> </html> <?php //only proceed if the form has been submitted if(!$_POST)exit(); //file creation // *******in order for this to work, chmod current directory to 777 //I ended up having to chmod this php file and the name.txt file to 777, not sure //if that was entirely necessary. foreach($_POST as $key => $val){ if($data){$data .= ', ';} $data .= $key; } $ourFileName = "name.txt"; $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file"); fwrite($ourFileHandle, $data); fclose($ourFileHandle); ?>
  10. donkeycocklovingslutmouth doesn't filter.
  11. All of those email addresses will probably get harvested for spamming. You could make images of them or use a form mailer right on the page.
  12. The quick and easy way, with no email validation: if(!($Name && $Age && $Email && $Comments)){ //form is not complete echo "You did not complete the form"; exit; }
  13. also the original link should not have quotes around the variable value. <a href="test.php?vid=12345">
  14. yes, this type of dynamic xml output works fine, I do it all the time. before any output you should set header('Content-Type: text/xml');
  15. Are you actually inserting the binary data into the database or just a filename reference? I went through this problem about 6 months ago, at first we inserted the binary data into an actual database row and as the database got bigger, the performance started to suffer. We initially decided to insert into the database because the pictures were security sensitive. When your user uploads an image, it should be placed on the server and only a filename reference should be inserted to the database. For the sake of privacy,you might want to (what we did) keep the images under the document root, and then you have to read_image() or something like that - i have a script that works, but I have to go to class now. Let me know if you want more information. Curt
×
×
  • 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.