-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
Would have been nice if you pointed out where line 23 was.
-
Count the number of times a page has been viewed
ginerjm replied to ababba2's topic in PHP Coding Help
Does the php script get executed BEFORE the video is shown? If so then the update has to occur. I don't buy the idea that joomla caching your html output will interfere with your php script that builds it. Your click triggers a php script, correct? If so then that php script HAS to run and if your logic is correctly placed it has to run and your count has to be incremented. That has to happen! -
Split numbers from '-' delimited list and enter them into an array
ginerjm replied to bluefrog's topic in PHP Coding Help
Have you read the manual for the 'explode' function? -
Count the number of times a page has been viewed
ginerjm replied to ababba2's topic in PHP Coding Help
So - you do have a php script. And you know which video is to be shown. So the first thing that script should do is to update your counter table. How does a joomla cache interfere with that? -
Sorry. Dont' know what this last set of code has to do with "1 to 4". Have you tried to show the id values you get in your first query before you continue on with all the rest of the code? What do you see when you do that? BTW - you should prepare the query ONCE - outside the loop - and then just bind the values inside the loop. That's the whole point to having a prepared query.
-
Count the number of times a page has been viewed
ginerjm replied to ababba2's topic in PHP Coding Help
What handles that click action? You say that a "php script runs". So? Why doesn't that script update the count? -
What the heck is this line: $rows = $xpath->query("//span[@class='price']"); That line has to give you some kind of error. What are you trying to do there?
-
Count the number of times a page has been viewed
ginerjm replied to ababba2's topic in PHP Coding Help
Some of us don't just click on links provided in posts. Some of us want specific answers to question or specific code that has a problem. Maybe you could answer my last question instead of posting whatever you just posted. -
Urgent? Really. You need something "urgent"?. Better get writing then.
-
Are you sure this is PHP you are discussing? I may be new and these may be old, but my search of the manual did not turn up any use of "see" (or @see) nor FQSEN.
-
Count the number of times a page has been viewed
ginerjm replied to ababba2's topic in PHP Coding Help
We need to do some definitions clearing up here. Your article talks about "article" hits. Can you define for me what pages you are attempting to count? If you are displaying a requested document (not a script) and want to have it counted every time it is requested, that is definitely not what we(?) have been giving you. Of course I can see why joomla as well as a browser would give you the cached copy instead of a new one. So - when the user clicks on whatever you have on your webpage in order to see a new document, what actually happens? Is there a form submit to a php script? Or at least an anchor href pointing to a php script? -
Why don't you pick ONE problem and show us that code? Perhaps if we solve that one, the others will fall into place for you. Key thing is to Show the Code.
-
Count the number of times a page has been viewed
ginerjm replied to ababba2's topic in PHP Coding Help
So then perhaps you should direct this topic to a CMS forum, or even a Joomla one. -
Count the number of times a page has been viewed
ginerjm replied to ababba2's topic in PHP Coding Help
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? -
Count the number of times a page has been viewed
ginerjm replied to ababba2's topic in PHP Coding Help
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. -
Count the number of times a page has been viewed
ginerjm replied to ababba2's topic in PHP Coding Help
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.
-
Count the number of times a page has been viewed
ginerjm replied to ababba2's topic in PHP Coding Help
In that case, I already gave you my $.02 -
Count the number of times a page has been viewed
ginerjm replied to ababba2's topic in PHP Coding Help
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. -
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.