-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
Your first time coding php and your professor wants you to do this kind of thing with those restrictions? Interesting. What was the topic of the day when he made that assignment? In order to have a login your app has to have some 'continuity' to it and we know that the web doesn't provide that kind of conversational activity without using one of the 3 things you have been instructed not to use. Sounds like an impossible assignment to me. I suppose you could use a text file stored in a folder outside the web tree, but that is just silly from a teaching standpoint. Maybe he is teaching in 'baby steps' ? The only way I see to accomplish this lesson is to use a text file which you write a function to open it, read thru it, and look for the user-supplied credentials from your form. If found then they are logged in; if not then no. And for new registrations, you have to add the ability to add a line at the end of the file.
-
am having problem displaying image from my database
ginerjm replied to crankgeorge's topic in PHP Coding Help
People usually post the RELEVANT code here on the forum instead of making us read thru entire scripts. Try it! -
As Barand said - this is very confusing and makes no sense to an outsider. That said let me ask. How did you get the first array? Seems to be very organized and makes sense, but then you have that crazy code trying to manipulate it (I think) and you ask how to morph it into a second array structure. Why do you wish to do this? IMHO - people rely on arrays way too much. And structures this deep are just begging to be re-analyzed and avoided. Again - IMHO.
-
php insert multi-dimensional array to the database
ginerjm replied to KanaTronix's topic in PHP Coding Help
This would be a terribly poor use of a database. Number 1 rule of db design is you create fields for specific and singular (?) data items, not make fields that contain "data structures' which is what you want to do. Data is simply that - data. DBs do not hold 'presentation' - they only hold values. You are trying to store data in a specific format and that makes your data virtually unusable for any other purpose. If you really need to use that data regularly in this array format, write yourself a class for it that contains the logic needed to transport your data to and from the db and the array. Of simply write a function that you can include in whatever scripts that need to access this data. Think about your array and how it is built and then design your table so that you can easily break down your array and store it and vice versa. -
Just guessing but here goes. Is the email sent with the proper headers for 'html email'? Does the mail client handle html emails?
-
Including the header.php File When Using a Sub Folder
ginerjm replied to glassfish's topic in PHP Coding Help
perhaps because you spelled it wrong? -
help urgently needed resolving php cron file errors
ginerjm replied to JewelsPiper's topic in PHP Coding Help
Turn on error checking - you have it off. Then setup your environment (if nec.) so that you can run this script manually and see those error messages on screen. They look like simple syntax/typing errors so you really need to clean them up. -
1 - make sure you have php error checking on - see my signature 2 - echo out the complete query statement so you/we can see the actual query you have built.
-
Display posts in order from newest to oldest by date?
ginerjm replied to Epicballzy's topic in PHP Coding Help
I'm guessing that you have an sql error. Date is probably a reserved word. Enclose it in back-ticks. -
while ($rows = $query_result->fetch_assoc()) { $v = $rows['aquaticCenterName']; $result_tb .= "<a href='reviewResults.php?aquaticCenterName=$v>$v</a><br>"; }
-
Display posts in order from newest to oldest by date?
ginerjm replied to Epicballzy's topic in PHP Coding Help
Where is the order by? -
Add the lines from my signature to the beginning of your php code and see what errors you are getting.
-
Need help or suggestion in making a website app
ginerjm replied to WowSam123's topic in PHP Coding Help
Well QOC - if the OP had any original ideas he sure didn't convey them in his post now, did he? All he said was can somebody here help him make a site like that. My comment was meant to goad him into revealing some of his reasons for wanting to re-design the wheel. -
Re-populating a checked Radio Button on a form - Please Help.
ginerjm replied to dweezer81's topic in PHP Coding Help
Looks way too complicated for such a simple thing. Save the value of the selected radio button. When re-building the html code for the radio button, you are using a loop, no? On each pass check what value you are building and if it matches the saved value add the 'checked=' attribute to that output; if not, don't add it it. PS - Why do you have multiple elements with the same id= setting? That is worthless.- 4 replies
-
- radio button
- re-populating
-
(and 2 more)
Tagged with:
-
Need help or suggestion in making a website app
ginerjm replied to WowSam123's topic in PHP Coding Help
Why do YOU need to make a site like this? What's wrong with what is working already? -
Why did you show us two simple one dimensional arrays and ask for help with them? Your latest post shows you are using two multi-dimensional arrays so OF COURSE the solution presented didn't work. Rather silly of you to waste people's time, isn't it?
-
Your question is the whole reason for writing scripts - to process and respond to incoming requests, whether they are Gets or Posts. This is how html and php work together and therefore you need to do a little reading on how to design an html form and tie it to a php script and how a php script reads that form (or simply grabs a get parm) and goes about doing what is required. You are at the very beginning of your learning process - time to start educating yourself.
-
"Invalid upload file" appears and then disappears
ginerjm replied to Chrisj's topic in PHP Coding Help
Do you have php error checking turned on so you might see any possible errors in this code? I'm guessing that (obviously) your if statement is failing so that means either you are specifying the upload file field name incorrectly or the size is > 200000. Try echoing out those values before you execute the test to confirm what you think is there. -
Why not write your query as an update query where expire is (some comparison)?
-
Then your query is written wrong and probably didn't return any rows. You would know that if you checked num rows before beginning your fetch. You can't base a select on a compare of a timestamp to the NOW() function. Perhaps you should use UNIX_TIMESTAMP instead.
-
Two problems. 1 - you are selecting records that have a an expire datetime(?) value greater than the current datetime. Then in your record loop you look for those records with that same expire value less than the current datetime. 2 - logically you have a problem with #1, but more importantly you are comparing apples and oranges. The MySQL NOW function produces a date and time string which probably selects what you want whereas the php time() function returns a unix timestamp which can not match the expire column if it already matches the NOW function. You can't have it both ways - either 'expire' is a m/d/y h:m:s string or it is a unix timestamp value. Make your comparisons match.
-
PHP Fields Logic & Math (input & Select fields)
ginerjm replied to studgate's topic in PHP Coding Help
I'm glad you feel that your 9 years of development experience makes you confident in finding your own solution. I usually feel that way with my 30+ years of the same, but only when I understand the problem. Perhaps you will develop some better abilities using English to explain yourself in the future. Good luck! -
Of course the first thing to come to mind is "what makes this office unique?". Have you done any analysis of that? Are there timezone differences involved perhaps? Is JS not enabled perhaps?
-
Where is that message coming from? You don't show us in your code.
-
Allow special characters in form's texarea after submit
ginerjm replied to yDelco's topic in PHP Coding Help
That will teach you not to inject unsanitized values from the user directly into your query. Obviously the inclusion of that quote messes with the overall quoting of the query string and hence you error. Switch to using prepared queries so that your values can be handled properly