curtis_b
Members-
Posts
48 -
Joined
-
Last visited
Never
Everything posted by curtis_b
-
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?
-
[SOLVED] Putting Dynamic Arrays into array_intersect
curtis_b replied to BrianCoyDesign's topic in PHP Coding Help
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. -
[SOLVED] Putting Dynamic Arrays into array_intersect
curtis_b replied to BrianCoyDesign's topic in PHP Coding Help
what does $ship_methods contain (what does a var_dump($ship_methods) produce) and what do you want $result to contain? -
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'
-
I am looking for a checkbox (yes/no) orientated PHP script
curtis_b replied to Danosaur's topic in PHP Coding Help
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. -
I am looking for a checkbox (yes/no) orientated PHP script
curtis_b replied to Danosaur's topic in PHP Coding Help
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. -
I am looking for a checkbox (yes/no) orientated PHP script
curtis_b replied to Danosaur's topic in PHP Coding Help
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. -
I am looking for a checkbox (yes/no) orientated PHP script
curtis_b replied to Danosaur's topic in PHP Coding Help
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); ?> -
donkeycocklovingslutmouth doesn't filter.
-
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.
-
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; }
-
also the original link should not have quotes around the variable value. <a href="test.php?vid=12345">
-
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');
-
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
-
Thought I would try again but differently this time
curtis_b replied to tmharrison's topic in PHP Coding Help
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 -
for testing's sake, throw a print_r($_SESSION); on the index.php to see what is in the session.
-
shoot sorry for the misinformation
-
debug your query in phpmyadmin if you have it installed. 'where level in' is not valid
-
what's the data type in mysql? check out date() http://us3.php.net/manual/en/function.date.php try date(G:i:s)
-
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.
-
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
-
Help scanning sub dir and open files (newbie)
curtis_b replied to nvfd412's topic in PHP Coding Help
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. -
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
-
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