342 Posted Topics

Member Avatar for nonshatter

[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 …

Member Avatar for JRM
0
126
Member Avatar for albertkao
Member Avatar for vishalkhialani
Member Avatar for boet

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 …

Member Avatar for JRM
0
106
Member Avatar for nsutton

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?

Member Avatar for JRM
0
206
Member Avatar for nonshatter

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.

Member Avatar for nonshatter
0
591
Member Avatar for whitestream6

[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.

Member Avatar for whitestream6
0
155
Member Avatar for seularts

[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 …

Member Avatar for JRM
0
161
Member Avatar for kiransharma

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 …

Member Avatar for sourcebits
0
105
Member Avatar for Coleman0610
Member Avatar for egoche

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 …

Member Avatar for egoche
0
120
Member Avatar for jvestby

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. …

Member Avatar for njm5785
0
78
Member Avatar for jrw89

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

Member Avatar for jrw89
0
135
Member Avatar for YenkoSC

The returned form info is in the $_POST[] array. example: [CODE] $msg = "Sender Name:\t$POST[sender_name]\n"; [/CODE]

Member Avatar for JRM
0
99
Member Avatar for MDanz

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.

Member Avatar for JRM
0
88
Member Avatar for Tekkno

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 …

Member Avatar for diafol
0
202
Member Avatar for niths
Member Avatar for JRM
0
40
Member Avatar for rajarajan2017
Member Avatar for rajarajan2017
0
144
Member Avatar for niths

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 …

Member Avatar for JRM
0
110
Member Avatar for SCoder1

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...

Member Avatar for diafol
0
88
Member Avatar for ritzrash

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.

Member Avatar for ritzrash
0
70
Member Avatar for jobojo

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 …

Member Avatar for JRM
0
168
Member Avatar for Reliable

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 …

Member Avatar for Reliable
0
81
Member Avatar for jnsnow

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.

Member Avatar for pritaeas
1
6K
Member Avatar for 6pandn21

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.

Member Avatar for 6pandn21
0
19K
Member Avatar for niths
Re: php

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 …

Member Avatar for JRM
0
77
Member Avatar for dirtyhiphophead
Member Avatar for MehdiAnis
Member Avatar for kumiyare

[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.

Member Avatar for kumiyare
0
98
Member Avatar for MDanz

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...

Member Avatar for somedude3488
0
86
Member Avatar for Muazam

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.

Member Avatar for JRM
0
84
Member Avatar for Midnite002

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.

Member Avatar for JRM
0
87
Member Avatar for JRM

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 …

Member Avatar for hashinclude
0
116
Member Avatar for cwarn23

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?

Member Avatar for cwarn23
0
654
Member Avatar for lifeworks

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 …

Member Avatar for lifeworks
0
129
Member Avatar for emhmk1

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]

Member Avatar for emhmk1
0
92
Member Avatar for JRM

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 …

Member Avatar for JRM
0
74
Member Avatar for grisha83

[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 …

Member Avatar for diafol
0
221
Member Avatar for MDanz

[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 …

Member Avatar for Arianna
0
69
Member Avatar for CFROG

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 …

Member Avatar for vsmash
0
104
Member Avatar for iniyanmani

[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, …

Member Avatar for OS_dev
-1
7K
Member Avatar for preetg

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.

Member Avatar for preetg
0
188
Member Avatar for BluMess
Member Avatar for senthilleo

wordpress has it's own docs . It's just a blog CMS. Did you install it yet ?

Member Avatar for hireaprogrammer
0
86
Member Avatar for Bhoot

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 …

Member Avatar for JRM
0
106
Member Avatar for Liles13

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.

Member Avatar for JRM
0
260
Member Avatar for nathan2oo3

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 …

Member Avatar for nathan2oo3
0
100
Member Avatar for SMHouston

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.

Member Avatar for JRM
0
195
Member Avatar for whitestream6

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 >= …

Member Avatar for JRM
0
145
Member Avatar for SuntechWebsites

[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 …

Member Avatar for JRM
0
108

The End.