Jump to content

curtis_b

Members
  • Posts

    48
  • Joined

  • Last visited

    Never

Everything posted by curtis_b

  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
  16. I had to do this for a job not too long ago. if memory serves me, you have to write a javascript function that returns true or false. then when you call the function you need to use the return statement like this: javascript.......................... function validate(){ //code for (if the number is good){ return true }else{ alert('error message'); return false; } } html............................... onClick="return validate()" -------------------------------- hope that helps - next time ask in the javascript forum
  17. for testing's sake, throw a print_r($_SESSION); on the index.php to see what is in the session.
  18. shoot sorry for the misinformation
  19. debug your query in phpmyadmin if you have it installed. 'where level in' is not valid
  20. curtis_b

    time()

    what's the data type in mysql? check out date() http://us3.php.net/manual/en/function.date.php try date(G:i:s)
  21. your code looks fine, and you shouldn't have to worry about the .ini settings, you won't have access to it anyway on your host. Who will be hosting the page? Check with them to be sure that your account allows php mail(), and that it is configured properly. 
  22. jesirose is right on, in addition, it is helpful to have javascript validate the form onSubmit, and manipulate the appropriate DOM elements with error messages for any fields that do not validate, otherwise, if everything checks out > submit. Validation in both js and php for one form is common. Curt
  23. I had to do this too, create a script that could search an ever-changing fileserver on our network. I used ajax - you can see a demo of the app here: [font=Verdana]http://www.curtisbranum.com/portfolio/ajax.swf[/font] anyway, I don't have the code with me, but I'll try to remember to post it when I'm at work tomorrow. To speed things up, I have one script that builds a db table of all current file/folder names, so the php script is really just looking through the database table.
  24. I'm bangin my head against the wall on this one: SELECT * FROM 7cp.LabelOrders LEFT JOIN (7cp.LabelCatalog, 7cp.LabelOrders_Common, 7cp.Locations, 7cp.Serials, 7cp.LabelCatalog_Plates, 7cp.Production) ON ( LabelCatalog.RevisionID = LabelOrders.RevisionID AND LabelCatalog.LabelID = LabelOrders.LabelID AND LabelOrders_Common.PO = LabelOrders.PO AND Locations.LocationID = LabelOrders_Common.ReceiverID AND Serials.Serial = LabelOrders.Serial AND LabelCatalog_Plates.LabelID = LabelOrders.LabelID AND LabelCatalog_Plates.RevDateID = LabelOrders.RevDateID AND Production.Serial = LabelOrders.Serial ) WHERE LabelOrders.Serial = 85 LIMIT 0,1 **The above query WORKS, but most of the data returned comes back as null when there should be data. Through assembling the query peice by peice, I've found out that the problem is with the LabelCatalog_Plates table. That is, if I remove that table from the join (and the relationships) the data expected comes back, yet if I include it, most columns returned (that DO have data) come back as null. If anyone can offer suggestions - I appreciate your help. Curt
  25. Hi, I've googled this issue (and searched here) and the explanation I've found is that the parent divs need to have height:100% (html,body), but that solution doesn't seem to be working for me. Check out the site: http://7cpco.com/beta/index.html and the css: http://7cpco.com/beta/css.css If it all fits in your screen, resize your window (to be smaller), what's happening is that when the content extends beyond the viewport, the background will not keep going, it stops before the content ends (in both FF and IE). Thanks for your help! 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.