-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Posts posted by ginerjm
-
-
To be accurate - you haven't posted YOUR code. Humor us and show us what you have typed up so that we can be sure that we are looking at your running code.
-
So - let's see some of your code now.
-
I don't know how you are doing this that makes the cache affect you. I do this all the time. Every time my script executes it checks if it has already been run and is processing a response, or if it is the "first" time it has been called. If it is the "first" then I increment my counter. Obviously this won't tally up refreshes, but why would you want to do that? It doesn't tell you anything about usage.
So - show us your code for keeping your hit counts so we can see why the cache is affecting you.
-
It's simply a matter of uploading a file - video or not. Plus - you really shouldn't be saving video files (or image files) in a table. There is no reason to do that. The file can be pointed to (by name) from a db table that may contain information about it, but you don't need to save the file also in that table.
Create a default folder for your video/image files and link to them from the table.
Also - do some googling (or read the manual) for how to upload files with php.
-
Read the manual to see how you should be writing the mail() call. You're missing something.
-
In that case, I already gave you my $.02
-
My phpinfo does not show an element called HTTP_CACHE_CONTROL - does yours?
I realize that you are trying to avoid repeated F5 hits here but is it really necessary. Why not just trigger "new" hits on a page with a snippet of code and a function that logs the data? I woule just check if there existed a submit value that comes from the current page; if it doesn't then it is a new visit to the page and I would log it. If not, I wouldn't.
-
When you finally do write some code and have a problem with it, post it here with your question and any pertinent error messages.
-
Happy to help!
-
You are doing a bindvalue as well as including an array in the execute call. More importantly you are assigning different values to your parm in each case. I'm confused and I am sure the SQL Server is more confused.
Personally I stick to the array method and never use the bindvalue one. That said - you should do ONLY this:
if (!$Startoff->execute(array('boxingid'=>$PostIdThing))) {//show error} else {//show success msg}
and leave out the bindvalue as well as the first call to execute.
-
Not a php question most likely. Sounds like an html one. If I were trying to highlight a part of a string being output I would wrap that part in a span tag and set a style for it.
-
Why not just use a pdf printer driver in your browser? Or better yet - design a better output more suited to a print-job rather than a web page and use a pdf extension such as FPDF in your php script to output it.
-
If you are storing a timestamp in the "kick" field, it must be hard to store a text value in there. I'm guessing that you don't have that field defined as a time-related field which makes it hard to use that comparison you have in your where clause.
Try defining your kick field as a timestamp and then add another field as a flag to be set when you want "permanent" status set on this record.
-
I really think that if you did RTFM you would have a better mental outlook on how a query works and how various functions enable you to get what you want out of it. If you think that you can actually become a 'good' programmer without ever availing yourself of the specific knowledge available in the documentation for the tools that you may use in that learning process, you are sorely disillusioned.
-
You might get a quicker solution if you posted the latest change to your code showing how you used var_dump.
- 1
-
Since nobody else has responded to your vague question, I'll ask. What do you mean by "shares"?
-
As previously mentioned - you should really send an email asking the user if he wants to reset his password to avoid someone hacking and causing you to make a change that the user didn't request. Add a hidden field to the reset form that you provide the user if he responds 'Yes' to be able to detect a valid reset request from the user as opposed to the perhaps invalid request from a hacker.
-
It doesn't make sense that you can't break out your thoughts into distinctive sentences when you write non-code.... Come on - you guys invented English!
-
And where oh where did your previous writing style go to already?? So messy..... tsk tsk tsk
-
So where is your query defined? $sql?
You could also read up on html tags that are deprecated. Such as <font>. And how to use css to make styling your html much simpler.
A major improvement in script development would be to learn how to keep you html block of code completely separate from the php block of code. You begin your script with the start of an html doc. What's the rush? You should begin with the php code and the logic to determine what exactly you are supposed to do at this instant. Then do it. If it involves building some formatted (ie, html) output, then do that as part of your query results loop and store it in a php var that you then embed in your html block where it needs to go.
Splitting things up like that makes it Sooooo much easier to follow - for you and for us - and easier to debug later on and easier to enhance and add features such as more html or more php logic.
-
As resident nitpicker here, you could also learn to write your sentences with caps and periods so all your thoughts don't just flow at us without making sense.
-
IMHO - When a user enters incorrect credentials you should simply put back the login screen with/without the incorrect userid and NO password and a message saying that the entries were invalid. This way they get to try again without having to click on boxes.
Don't send back the password, just the userid entry to avoid multiple transmissions of a possibly valid pswd.
- 1
-
YOU built this script? It is so outdated I find that hard to believe.
-
A good model for script design is to set your php code all up front and your html all at the end. They don't need to mix unless you are using php vars to convey html with dynamic embedded data into the final webpage output.
Keeps the logic and heavy work away from the presentation and display work. No need to output intermittent dribs and drabs of html while you are trying to write the "serious" code.
Count the number of times a page has been viewed
in PHP Coding Help
Posted
That code is pretty weak looking. You test two things to see if they failed, but when they do you don't output anything to tell you they failed. Echo-ing out an empty string as you do is not very helpful when something didn't work. And if it didn't work you continue on with the rest of the script anyway. Why?
To top it all off - you then do your update query and once again you test for failure but don't put out a message whether it actually updated or not.
As for caching - how does a php script get cached on the browser since it only exists on the server?