dotMobimobiThinkingmobiForgemobiReadyDeviceAtlasgoMobi

Posted by deepblue_tiano 4 years 1 week ago

pic
 deepblue_tiano
mobiForge Newbie
Posts: 8
Joined: 4 years ago
[offline]

Hello again mobers, Can anyone help me with the wapsite that currently I'm working on.. I having trouble redirecting the phone to the streaming server because i use to count the number of clicks the user streamed the video..In my php code i used header("Location: ".STREAMING_FULL_PATH.$video->getContentProvider()."/".$video->getServiceCode()."/"
.$video->getTariffCode()."/".$video->getFileName());
where STREAMING_FULL_PATH is rtsp://ip address/ plus the directories+filename.. I really appreciate your help..thanks..

Posted by shane 4 years ago

pic
 shane
mobiForge Newbie
Posts: 7
Joined: 4 years ago
[offline]

Add a normal (a href) link to your page that will link to another page within your site.

From this second page, record the click and do a Response.Redirect (not sure what the php equivalent for redirect is) to the streaming video.

Posted by deepblue_tiano 4 years ago

pic
 deepblue_tiano
mobiForge Newbie
Posts: 8
Joined: 4 years ago
[offline]

shane wrote:
Add a normal (a href) link to your page that will link to another page within your site.

From this second page, record the click and do a Response.Redirect (not sure what the php equivalent for redirect is) to the streaming video.

shane thank you for replying to my post, currently i have a page where i count the number of view of that video and increment it but i cannot found a php script that the phone will understand as usual href, header +location doesn't work in nokia phones.

Posted by daniel.hunt 4 years ago

pic
 daniel.hunt
dotMobi logo
Mobile Grandmaster
Posts: 230
Joined: 4 years ago
[offline]

deepblue_tiano wrote:
as usual href, header +location doesn't work in nokia phones.

Which Nokias in particular are you talking about? I've not had any difficulty with a php header('location: blah'); on any nokia I've tested it on. The main issue with a header location redirect is when you are dealing with form submissions.

There's an RFC that states that if a page redirects after a form submit, then the device is required to resubmit the data to the new page, which causes a little bit of confusion, as you can imagine.

Daniel Hunt
dotMobi

Posted by deepblue_tiano 4 years ago

pic
 deepblue_tiano
mobiForge Newbie
Posts: 8
Joined: 4 years ago
[offline]

I've tested it in nokia 6680 and huawei U256, the error got in nokia is web page not found,while in huawei cannot find file.. Okay let me explain to you.. I have a page where i have a link preview and view.. the link preview is usual href="rtsp://IP ADDRESS/file.3gp while in view i uses another page which is php to count the number of views of the specific video..I uses header("Location: "rtsp://IPADDRESS/tFileName.3gp) to send back the link to phone but i believe the interpretation of phone being sent by header is not a link beacuse of rtsp? What do you think?. It works fine in motorola and LG only in nokia and huawei doesn't..

Posted by elias 3 years ago

pic
 elias
mobiForge Enthusiast
Posts: 16
Joined: 4 years ago
[offline]

Hi,

try with http 302 (temporary move) and add a Location header with the rtsp uri. This is a client redirection and works with Nokia, SE, Moto, LG, Sharp, Samsung devices.

Elias Giannopoulos

Elias Giannopoulos

Posted by alen_ribic 3 years ago

pic
 alen_ribic
mobiForge Newbie
Posts: 3
Joined: 3 years ago
[offline]

daniel.hunt wrote:
There's an RFC that states that if a page redirects after a form submit, then the device is required to resubmit the data to the new page, which causes a little bit of confusion, as you can imagine.

Daniel,

How do you go about preventing mobile users from reloading the posted data?
The reason I'd like to do a redirect after user POSTs form data is so that he, she can't reload the form submission. (which could result in duplicate data, etc.)

Regards,
-Alen

PS:
m.facebook.com seems to pull it off. They use post method for login and if I try refreshing the next screen in pc browser, I don't get the "The page you trying to view contains POSTDATA..."

Posted by daniel.hunt 3 years ago

pic
 daniel.hunt
dotMobi logo
Mobile Grandmaster
Posts: 230
Joined: 4 years ago
[offline]

alen_ribic wrote:
Daniel,

How do you go about preventing mobile users from reloading the posted data?
The reason I'd like to do a redirect after user POSTs form data is so that he, she can't reload the form submission. (which could result in duplicate data, etc.)

Regards,
-Alen

PS:
m.facebook.com seems to pull it off. They use post method for login and if I try refreshing the next screen in pc browser, I don't get the "The page you trying to view contains POSTDATA..."

That's actually quite a common procedure with modern CMS's. If you notice, you'll see its also done on this site by Drupal :)

The main issue with what you're asking (and the one that I came up against myself) is that the RFC states that every browser should obey the following RFC: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

Quote:
10.3.3 302 Found

The requested resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field.

The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s).

If the 302 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.

Desktop browsers appear to ignore this for what I presume are usability reasons (and, in my opinion, rightly so). However on mobile devices, it appears as though this RFC is adhered to strictly, making what you want to do impossible.

Does this help you? I assume you're talking about form submit redirects on mobile devices in general by the way, even though you specifically mentioned a desktop browser for m.facebook.com.

Daniel Hunt
dotMobi

Daniel Hunt
dotMobi

Posted by alen_ribic 3 years ago

pic
 alen_ribic
mobiForge Newbie
Posts: 3
Joined: 3 years ago
[offline]

Thanks Daniel for your reply.

I can't say I have read the RFC 2616 before in much detail, but I was almost convinced that it was recommended to do a redirect after a POST. Guess I was wrong.

Here is an example of one recommendation, though it probably does not take mobile browsers in to consideration:

Quote:

Redirect After POST

If a user selects Refresh on a page that was displayed by a POST request, that request will be repeated. This can often lead to undesired behavior, such as a duplicate record being added to the database. Redirect after POST is a useful pattern that can help avoid this scenario: after a successful POST has been processed, redirect the user to another page rather than returning HTML directly.

Source: http://www.djangobook.com/en/1.0/chapter07/ (Python web framework)

Quote:

Desktop browsers appear to ignore this for what I presume are usability reasons (and, in my opinion, rightly so).

As per what I wrote in my first reply and a quote above, its not just for usability reasons that the HTTP redirect after POST is useful, but also to prevent users from doing a refresh on data that has already been posted.
(Submitting a form twice or more times.)
So that's the part I have been seeking a same or similar solution for in mobile space.

Oh and I tried the post with 302 redirect on a Opera mini 4.1 browser and it actually is the only mobile browser that it works fine with. (Not good enough since I need to support more then just Opera mini so I'll stick to just doing a post and then rendering a follow up page instead of a redirect to the follow up page.)

Regards,
-Alen

Posted by daniel.hunt 3 years ago

pic
 daniel.hunt
dotMobi logo
Mobile Grandmaster
Posts: 230
Joined: 4 years ago
[offline]

alen_ribic wrote:
I can't say I have read the RFC 2616 before in much detail, but I was almost convinced that it was recommended to do a redirect after a POST. Guess I was wrong.

As per what I wrote in my first reply and a quote above, its not just for usability reasons that the HTTP redirect after POST is useful, but also to prevent users from doing a refresh on data that has already been posted.
(Submitting a form twice or more times.)
So that's the part I have been seeking a same or similar solution for in mobile space.

Oh and I tried the post with 302 redirect on a Opera mini 4.1 browser and it actually is the only mobile browser that it works fine with. (Not good enough since I need to support more then just Opera mini so I'll stick to just doing a post and then rendering a follow up page instead of a redirect to the follow up page.)

I'm not exactly well-versed on HTTP RFC either ;)

I understand what you're trying to do, and I also understand why you're trying to do it (I've done this exact thing on countless custom CMS implementations I've developed too). The holding page approach is probably your best bet for what you're trying to do, however you should remember that users will actually be paying for the data transmitted both to and from your server, so they may not like having to pay for the data required just to get past a holding page.

Also, its quite likely that they're accessing your site via a very slow connection, so downloading a holding page is (again) undesireable for them!

There are pros and cons to every approach, but I'm sure you'll pick the one that suits you most.
Let me know how you get on!

Daniel Hunt
dotMobi

Posted by alen_ribic 3 years ago

pic
 alen_ribic
mobiForge Newbie
Posts: 3
Joined: 3 years ago
[offline]

Thanks again for your reply and I am happy to have gotten this one out
of the way for now.
Holding page (Without 302 or 301 redirect) is the way I decided to go from here in case of POST method handling.
And you are absolutely right that both have pros and cons. Holding
page approach though outweighs the redirect in mobile scenario.

-Alen

Posted by creative96me 3 years ago

pic
 creative96me
mobiForge Newbie
Posts: 1
Joined: 3 years ago
[offline]

deepblue_tiano wrote:

shane thank you for replying to my post, currently i have a page where i count the number of view of that video and increment it but i cannot found a php script that the phone will understand as usual href, header +location doesn't work in nokia phones.

Hi to all! I have the same problem with Location + rtsp link. If you have any solutions - help,please!!!

shane wrote:

try with http 302 (temporary move) and add a Location header with the rtsp uri. This is a client redirection and works with Nokia, SE, Moto, LG, Sharp, Samsung devices.

Does it mean:
<?php
header("HTTP/1.1 302 Found");
header("Location: rtsp://86.57.251.29/video/14530.3gp");
?>

Posted by arcade 3 years ago

pic
 arcade
mobiForge Newbie
Posts: 6
Joined: 3 years ago
[offline]

creative96me wrote:

Does it mean:
<?php
header("HTTP/1.1 302 Found");
header("Location: rtsp://86.57.251.29/video/14530.3gp");
?>

That could ba a good answer about mz problem too!!!
http://mobiforge.com/forum/developing/mobile-web-development/header-redirect-405-error-nokia-6070

Anyone in to tell me???

Posted by arcade 3 years ago

pic
 arcade
mobiForge Newbie
Posts: 6
Joined: 3 years ago
[offline]

See http://mobiforge.com/forum/developing/mobile-web-development/header-redirect-405-error-nokia-6070

Posted by pulsorock 2 years ago

pic
 pulsorock
mobiForge Newbie
Posts: 2
Joined: 2 years ago
[offline]

I'm having this same problem. I've created a .php script that does some user account validation, download tracking to the DB (for analytics of the videos viewed) and the method of viewing (stream or download).

This is the last part of the code that makes the redirect:

<?
// Filename define from DB. ie:
$video_file = "file.3gp";
 
switch ($download_method) {
    case "stream":
        $server_host = "rtsp://192.168.1.120:554/";
        break;
    case "download":
        $server_host = "http://192.168.1.120:8134/";
        break;
}
 
// Redirect to video URL
$redirect_url = $server_host . $video_file;
 
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$redirect_url);
exit;
?>

I've read the posted comments and the links, but haven't found a way to accomplish a redirect to a rtsp:// using PHP on my phones.

Is that even possible at all?

Posted by xiaopy12 1 week ago

pic
 xiaopy12
Mobile Champion
Posts: 582
Joined: 1 week ago
[offline]

Louis Vuitton Outlet Onlineliubhu