342 Posted Topics
Re: [QUOTE=nonshatter;1212712]Hi all, I'm need to devise a server-side method of preventing multiple form submissions. The form is submitted to the same page. I have read about generating a unique value in a session and insert a hidden input field to detect multiple submits, but would this work with a same-page … | |
Re: try: [CODE]echo exec("./testprog");[/CODE] | |
| |
Re: Generally speaking, if you are getting a blank page after submitting to a PHP file, it means that you have a syntax error or some other fatal error in the file . If you are testing this on a localhost machine, then set PHP errors_all to on and display errors … | |
Re: Sorry to hear about your "suckiness"! Grab a copy of phpmyadmin to make your life easier. It's a gui interface for MySql. Works great. Don't code without it! Otherwise, you can do command line Mysql if you want to be "hard-core". BTW i assume that you have MySQL installed-right? | |
Re: You can add a timestamp and user columns to the table. Use these to detect if the table is in use; For example, if the initial test query returns null time and user, the update query is allowed. | |
Re: [QUOTE]Sometimes a record from the table episodes will be repeated multiple times, other times it won't... this is causing my PHP script to have some issues![/QUOTE] Maybe start with the database duplication? You don't show the code that may cause that. | |
Re: [QUOTE=seularts;1207609]I need to write many files in my script, so chmod 0777 is kind of necessary and also upload lots of images in the folder. I didn't know of any negative impact of this exactly.[/QUOTE] PHP itself has access to everything. I don't understand why you want the whole world … | |
Re: What kind of help do expect with a vague question like that? Here's an equally vague answer: You have a code error somewhere... Sorry to pounce on you, but please understand that we are not looking over your shoulder or telepathic. Questions should be concise and preferably accompanied by the … | |
Re: Assuming that this is a localhost sandbox, I suggust that you set the PHP ini to display all errors. Normally, they are logged in a production server. The on screen error display is a great diagnostic tool. I suspect that the error has to do with conditional logic which has … | |
Re: Mysql date structure is YYYY-MM-DD. (I thought that was Euro-style!) It's not configurable. We use MM/DD/YYYY here in the USA, so we have to bend and twist the date into our format. Anyway, you use the PHP functions strtotime() and strftime() to manipulate the date into whatever format you wish. … | |
Re: I think it might be this line. [CODE]$document->documentElement->appendChild($head);[/CODE] maybe change it to: [CODE]$document->appendChild($head);[/CODE] You didn't get an error because the code is OK, but it just isn't doing what you expected | |
Re: The returned form info is in the $_POST[] array. example: [CODE] $msg = "Sender Name:\t$POST[sender_name]\n"; [/CODE] | |
Re: before you insert, do a query for the origin number that you are about to insert. If the query comes up empty, you can insert the number. | |
Re: Maybe we should start by asking whatt you are trying to accomplish with this query. "Order BY" refers to how mysql returns the sort order. How does a random floating point between 0 and one do anything useful in this context? I wonder how how you got any results at … ![]() | |
![]() | Re: try this link: [url]http://cert.w3schools.com/php/default.asp[/url] ![]() |
Re: how are you collecting the varibales for insertion here? [CODE] $sql="insert into files(filename,size,uploadedby,projectid) values ('$filename','$size','$_SESSION[username]',$projectid)"; [/CODE] If you want to collect background info from a form use input tags with type = "hidden" attributes. You will have them in a $_POST array after a submit. If you dont want to … | |
Re: This line has a () that are probably killing the query [CODE]$sql="INSERT INTO item_inventory () VALUES ('$_POST[item]','$_POST[description]','$_POST[price]')";[/CODE] BTW, doing raw POST inserts from users is asking for for trouble. See sql exploits... ![]() | |
Re: Without knowing more, it's impossible to tell you . I don't think it's anything to do with Apache or PHP, but some kind of code error (or omission). Are you running PHP with display errors on? It shouuld tell you something about what is going on. | |
Re: Sorry to say, but it sounds like you need a MAJOR re-write. Maybe the simplest thing to do is to use a open source CMS like Joomla or Drupal to put your content on. They have most of the security stuff worked out already. There is just too much to … | |
Re: In what context are you referring? Functions ? [CODE] function myFunction($var1, $var2){ return ($var1 + $var2); } [/CODE] In the example above I passed var1 and var2 into a function that adds them together and returns the result. [CODE] //call this function $total =myFunction(1,2); [/CODE] I passed 'hard coded' numbers … | |
Re: I belive that the single quotes around the variables prevents PHP from parsing them as variables. This would insert literal value '$name' into the database IF they were all text. However, MySql will error out due to type misimatch for the non-text types. | |
Re: make sure that the directory owner and group settings match. Directory should permissions be 755 and files 644. in the shell run stat Your_Directory_Path this will show all of the parameters. | |
Re: keep in mind that that entire page of code re-runs from the top down when you you hit submit...or at least it should. As mentioned by sunsetrainbow, you should use the the form tag to tell PHP what action to take , ie; what form handler to use upon a … | |
Re: besides the directory perms, did you check the owner and group names? | |
Re: Firezilla is a very good FTP client. It also supports SFTP. | |
Re: [QUOTE]my problem is if the browsed file reside in the same directory as script it works fine, but when the file is outside of the script directory it is not working.[/QUOTE] Seems to me that you answered your own question! Supply the proper file path to the script. | |
Re: Perhaps the the the first index produces a negative result? see: [url]http://us3.php.net/manual/en/function.array-slice.php[/url] it will then start from the end of the array. Just a thought... | |
Re: It refers to an iteration of the array $text if there is only one cell, then it may not make any difference. However, there may be situations when there will be cells to be iterated. removing the index will crash the script and/ or give unexpected results. | |
Re: You could redirect back to the original page, but you would also have to echo back the data that was entered, otherwise the form will be blank. | |
I have a situtation where I need to use the variables created during a session on another page. currently, I am doing the queries twice, which seems like such a waste! Is is possible to retrieve them via the session store? This is my first foray into the bowels of … | |
Re: Do you think it is wise to post that in the public domain so that every nut and his brother can run a muck on the internet? | |
Re: I think you may have misunderstood the public/private classifications in the context of PHP coding. "private means that the method or variable is only available within the class. It does not have anything to do with internet access . Since PHP is sever side, the users will not have any … | |
Re: usually after you make the connection, call mysql_query() to set your query then call mysql_fetch_array() . Then you will have an array to read out. The ultimate authority is here: [url]http://php.net/manual/en/book.mysql.php[/url] | |
I'm stumped. I have a box model that is controlled by css in other parts of a CMS. For simplicity, lets say it's like this: [CODE] <div.a> <div.b> <table> </table> </div> </div> [/CODE] I wish to print the raw table in the midst of the divs without the CSS margins … | |
Re: [QUOTE=grisha83;1150213]Hey guys, I am trying to do the basic :hello world" in PHP When i compile the code, my browser doesn't display "hello world" it is giving me an error: "You tried to access the address [url]http://localhost/PhpProject1/index.php[/url], which is currently unavailable. Please make sure that the Web address (URL) is … ![]() | |
Re: [QUOTE=MDanz;1150241][CODE]$thenumber = 0; $thenumber++; [/CODE] i've tried putting this inside the brackets for the for loop and it isn't working. the number stays as 1. theres alot of code so i can't post the whole for loop.[/QUOTE] I dunno, maybe the ++ stuff only works in the context of a … | |
Re: Yes This site is a great resource, but some do abuse it . They (you know who you are!) repeatedly post code with basic syntax errors asking others to troubleshoot it for them. I agree that getting a foundation with a book, Google, W3, and the PHP site is where … | |
Re: [QUOTE=benkus;1113716][CODE]<script type="application/javascript"> function hello(clicked) { alert(clicked); return false; } </script> <form action="<?php echo $_POST['fname']; ?>" method="POST"> <input type="text" name="fname" /> <input type='submit' name='Release' onSubmit="hello(document.getElementsByName('fname'))'' value='Submit'> </form>[/CODE] Does that work for you? =) I'm not that old in PHP either... But I guess this should give the basic idea at least, … | |
Re: You didn't provide the test file, so I think the code may be failing due to what is or is not in the test file. You can insert some var_dump() 's to see if the expected arrays are being returned. | |
Re: Did you look into joins? | |
Re: wordpress has it's own docs . It's just a blog CMS. Did you install it yet ? | |
Re: The web root is determined by the directives set in the server config file. It is not something that you can arbitrarily determine uless you have acess to the ineer workings of the server. Most linux distros use html or public_html as the doc root folder name. However, you can … | |
Re: 1) read the sticky above 2) your title gives the clue to the problem! 3) Nobody is going read all of that code to find the spot. cut it down to the offending area. | |
Re: The only reason that it would give the "unknown column" error is if the column does not exist or there was a misspelling of the name that causes a mismatch, The $username might not be parsed as a variable because it is is enclosed in single quotes. The overall double … | |
Re: There is no form submit to invoke the php handler once the data is filled out. PHP runs before the form is displayed, or again if "self" is invoked in the form action. If you want "real time" results , you might want to look into javascript. | |
Re: since you already have a table with the shows, times and images, use it to pull up the info. query the data base show time so that it will respond to a range of times. ie; if the show is an hour starting at 5pm use: [CODE] where time >= … | |
Re: [QUOTE=SuntechWebsites;1137458]Ok..I have a database with clients and their information. They can login using their own assigned username and password. I am looking for a way I can access/edit their info from my admin side without having to enter individual user info to access them. On another note I am looking … |
The End.