-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Posts posted by ginerjm
-
-
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?
-
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.)
-
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?
-
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?
-
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.....
-
Hopefully you have corrected that query sample you posted and that you have converted from using the deprecated MySQL_* functions from your script.
-
I wouldn't call Barand's code OOP. It's the same code I use and I don't use OOP very often at all.
So - it doesn't work. Care to enlighten us as to what error you are getting or what makes you feel it is not working? Maybe post your code so we can see what you are running. Be sure you have php error checking turned on too!!
-
I tried following you before, and just looked at this last post and still don't understand.
How about giving us a real life example such as:
Example 1:
John Non1
John Non2
John Non3
...
...
...
jane local1
Jane local2
Jane local3
and show us how you want to see that output. What you gave us now gives you this:
john non1 jane local1 jane local2 jane local3
john non2
john non3
My original interpretation of what you wanted was something like my Example 1:
Non Locals:
john non1
john non2
john non3
Locals:
jane loc1
jane loc2
jane loc3
That is not what you want?
-
Look at your script!! YOu blindly create php vars using stuff that may or may not exist. Then you output the email and send a success message. Where is you logic? Where do you even check if you have $_POST vars?
You obviously are learning, but you also are obviously not used to programming in any language. YOu have to look at your code and know what it is doing and be sure that is what you want it to do.
Start your script at the top by checking if a specific POST variable exists. I like to use the button value that the user clicks to submit the form. So if your submit button is named "btn" and the value of the button is 'Submit', then my first line would be :
if (isset($_POST['btn']) && $_POST['btn'] == 'Submit')
{
continue with form processing and email
build a success or failure message such as $msg = "???";
}
else
{
handle the first time thru this script of some other submit button process (Cancel or Return??)
}
DisplayPage(); // call a function that displays all of my html code - the form and any messages.
exit();
-
Show us your code that doesn't work
-
Why not just query all the members but order them by local or non-local and then make your table heading row as your go through the results in a loop and look for when you change from local to non-local data?
-
What would be really nice is for the community/authors to FINALLY remove MySQL instead of having this long denouement. Of course it has come to fruition, but many, many users do not yet run the most current version. My hoster is currently only on 5.5
-
Without trying to follow your convoluted code, I wish to point out and ask one question. You start, quite properly I believe, by getting a list of the contents of your chosed directory. Then you start a loop on that array holding those names. But then you re-open the dir and start plucking filenames again which you already have available to you. Why? Seems to me you have what you need and should be simply attaching a handle to each and renaming it if it fits your conditions.
-
I think it is merely your path specification. Your glob argument is path/path/* . Do you have files named x or are they x.jpg, x.bmp, etc?
Try path/path/*.*
-
You didn't escape the " at the end of the src= string. Try using single quotes so you don't have to escape the doubles.
echo "<td width='100'><div align='center'><img src='http://www.brickbybricks.ca/php/images/" . $row['Color_Name'].$row['PartID'] . ".gif'></td>";
See how the entire string is in double quotes but the attributes inside of the tags are in single ones?
-
Barand gave you the exact code to use. Insert it into your existing code where it should be and see what it tells you.
-
1 - you should not use a GET input directly without first checking that it is proper and not malicious.
2 - What you are showing me is that you are outputting a checkbox with a value that is equal to the very same checkbox that you must have already received. What is the point of this?
How to redirect users when no files are found
in PHP Coding Help
Posted
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.