-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
I have no idea what your response is saying. Punctuation and caps might help as well as a re-wording.
-
When one says "terminated by (space)" what will it do at the last field in the line which does not have a space at its end?
-
Are you checking for a MySQL error message? How are your table fields defined?
-
Why would one want to store a distinct file inside a database table? Afterall it is a stand-alone piece of information that, given a proper name, is easily identified, or if linked to a table that stores attributes about the file, can easily be located and retrieved. There is no need to have the overhead of storing it and retrieving if from MySQL. Create a folder and create a naming structure and upload the files to that place and save it with a name that matches your defined pattern. Should you need to have other characteristics about the file saved, then save them along with the file's name in a db table. If backup is your concern, then make a backup folder - either on the same system or on another.
-
You really need to do some reading and teach yourself how things work.
-
1 - your password s/b stored in a secured fashion - never in plain text. Read up on "password_hash". 2 - when you do your query you use the userid to get the record for the user. Then you use "password_verify" to see if the given password matches the one on file. Read up on that function as well. 3 - once your user logs in successfully, store his id and whatever other token you may need to recognize his permissions in $_SESSION variables. That way they are accessible by all the scripts that run during that session. Solves your "passing" problem. 4 - As already said - never store the password anywhere other than in the user record and even then only once it is hashed. Always use a POST method in your login form and not a GET PS - the use of AND in a where clause is not another query. It is another condition. But as I said - you don't do that here. Note - be sure that your table definition allows for a large enough value for the hashed password. See what the documentation suggests.
-
So you have a little module that defines paths /* paths.php $php_path = "/home/domain/php/"; $lib_path = "/home/domain/public_html/libs/"; ... ... Then in your code you include the above file and in your other includes you use the appropriate path var: include($php_path . "connect.php"); include($lib_path . "functions.php"); ... ...
-
Why not use constants for the path names and include a module that declares all these constants. Then your include simply reference the correct constant the the simple filename. You move things around - update the constants. Make them absolute too!
-
Uploading pdf to folder below public_html with php
ginerjm replied to bambinou1980's topic in PHP Coding Help
When you get a coding method written then ask for help to perfect it or improve it. Til then enjoy the learning process. -
Uploading pdf to folder below public_html with php
ginerjm replied to bambinou1980's topic in PHP Coding Help
We usually help people with their code. Not write their code. -
Uploading pdf to folder below public_html with php
ginerjm replied to bambinou1980's topic in PHP Coding Help
Why not read the php manual for functions that facilitate this? Try move_uploaded_file for syntax and examples. -
Why would you think that you can edit a server-based image that is not totally uploaded yet? I don't think 45 secs is such a long wait for a large file.
-
How to redirect users when no files are found
ginerjm replied to bambinou1980's topic in PHP Coding Help
You are saying you are concerned about passing parms but your previous examples only referred to files and folder names not in existence. BIG difference. -
How to redirect users when no files are found
ginerjm replied to bambinou1980's topic in PHP Coding Help
Instead of apache, why not use php to first check for the file or folder and if it exists issue a header call to it, and if not put out a polite message. OTOH - why do you have users typing in their own urls in the hopes that they make a hit somewhere? Why not give them a drop down of the available folders/files and let them choose a correct one? -
And you attempt to access something named 'submit' in the POST array. You didn't assign a name= to your submit button so you have none. For future reference (your next post?) - it's a better idea to actually indicate what you want in the subject/topic you post under. Naming your post as you did here is not much help in getting the attention you seek, other than from the curious who have the time to browse everything. Better pinpoint a topic that you wish help on than hope for someone's curiosity to cause them to read your question.
-
Ok - lost sight of that - was still thinking about primes.
-
Logic seems flawed. First - you only need to test half the value of the starting value - not the square root. Second - once you have determine that there is no remainder from your mod test, why do you continue on with that other logic?
-
php mysql one to many relationship or something else?
ginerjm replied to gbaya's topic in PHP Coding Help
Once the user begins the process by submitting the form and you save that info with an "id", you simply put out a form for the user to then submit images to be uploaded. Store those images in a folder with a table that relates each image file name to the "id" in a separate table. User table with id links to image table with id and image file name Store all images in one folder and always look in that folder for the image file name. Probably want to include the user "id" as a prefix to the image file name to ensure uniqueness. When you do a query you simply join the two tables together. You don't want to store the images themselves in a table - wasteful. Simply define a folder and just save the filename. -
Turn on php error checking to see if you have errors. (see my sign.)
-
PHP site not working after host migration - Urgent
ginerjm replied to lee_sov's topic in PHP Coding Help
1 - Put your programmer to work on it? 2 - Read my signature -
I have no idea what you are showing us here, but I cleaned it up in order to begin asking questions about it. echo "<p><a href='Images/rat-zodiac.jpg'><img src='Images/rat-zodiac.jpg'"; foreach ($Array as $Sign) { echo "alt='$Sign' height='125' width='100'/>"; echo "</a> $Sign<br />"; echo "<a href='" . key($Array) . "'><img src='" . key($Array); next($Array); One can use single quotes and double quotes to make things easier. Note how I did that in your echos. You start by outputting an anchor tag, using an image as the visible "link" for that anchor. But you leave the img tag incomplete and start a loop on the array to add more code to it. Your loop takes the first array element and adds some more attributes to the img tag and then closes the anchor tag and then outputs the current array value. Then you start a NEW anchor tag but then you lose me. What is the purpose of "key($Array)"? You are already looping on the array so why the next call. And then you grab the key of an element too. Also - why would you want to turn control over to a jpg file with that anchor tag at the start of this code?
-
$_SESSIONS and $_FILES not working anymore on shared server
ginerjm replied to gerarddd's topic in PHP Coding Help
1 - I don't see where you started the session in your code. 2 - In what way is the existence or even the value of your GET variable related to the existence of session support? The beginning of your code is creating a session variable and assigning a value based simply on whether the 'reload' parm is present and is set to 'true'. How is this getting presented to the script? -
PHP site not working after host migration - Urgent
ginerjm replied to lee_sov's topic in PHP Coding Help
1 - Is DOCUMENT_ROOT a constant that is declared somewhere? 2 - Do you have php error checking turned on so that you can see an "new" warnings or notices that may be happening with the new versions? -
Without helping you with your algorithm, I will point out your syntax errors with this: $Images = array("dog"=>"Image/Dog.jpg", "dragon=>"Image/Dragon.jpg"); [/php[ 1 - just one = sign to make the assignment 2 - as prev mentioned the array element operator(?) is => NOT =< An image gallery using arrays? Hmmm. Wonder how that is to be used long-term. If one really wants to create a gallery one must have a source for those images. Perhaps a folder? Then where do the labels come from in the array? Or are you building the array from user input in order to eventually save it as a file or a db table?
-
Never even noticed.....