Welcome to WebmasterWorld Guest from 54.167.252.62

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

The content received from the origin server was too large!

when using redirection with php on WAP

     
6:12 pm on Nov 11, 2003 (gmt 0)

10+ Year Member



This is the message i receive from browsing with wap. This is my php code:


<?
$host = "host";
$user = "user";
$pass = "pass";
$dbname = "dbname";

$connection = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>");
mysql_select_db($dbname);

$query= "select * from 4images_images where image_id='" . $_POST['image'] . "'";
$result= mysql_query($query);
// $num_results = mysql_num_rows($result);
$row = mysql_fetch_array($result);
$filename=$row['image_media_file'];
$category=$row['cat_id'];

$file="http://www.url.com"."/".$category."/".$filename;

header("Location:$file"); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;
?>

Is it a problem with my redirection script? Do i have to use other redirection technique to get the file? thanks in advance.

6:41 pm on Nov 11, 2003 (gmt 0)

10+ Year Member



by the way, the file is only 5 kb. :(
12:38 am on Nov 12, 2003 (gmt 0)

10+ Year Member



anyone, please please please help me out?
12:59 am on Nov 12, 2003 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



expert_21,

honestly we're not ignoring you. Where was the error returned from? Maybe 5k is too big. Any more info you can give us about the situation?

7:13 am on Nov 12, 2003 (gmt 0)

10+ Year Member



@jatar_k: thanks for replying! I understand that it's hard for you guys to answer without knowing the whole situation, but I don't know where else to get help :(

i got that message when i try to browse the page with a Sony Ericsson T610. My guess is, if redirecting doesn't work this way, is it possible to use other method to redirect the user to the file? Probably prompt the user to save the file instead (will this work on a mobile phone?) I am so stuck :(

1:19 pm on Nov 12, 2003 (gmt 0)

10+ Year Member



Hi everybody, i found the solution! the solution is to generate a link to the file, instead of redirecting straight away to the file. For those who wanted to know.

Btw, just wondering, if updating the database entry difficult? I already learnt how to access the information from mysql, but is it possible to update the data on the database once you've retrieved information from it? thanks!

1:44 pm on Nov 12, 2003 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



In order to access the data via SELECT, you must have learned how to INSERT the information, correct? Now there are two more basic data manipulation commands [mysql.com] to learn -- UPDATE [mysql.com] and DELETE [mysql.com]. It's as easy as that ;)
7:41 pm on Nov 12, 2003 (gmt 0)

10+ Year Member



ops, actually i didn't learn anything about INSERT. :( ok...i'll start straight away. Is this logic right?:

1) access the information from database
2) use update to update the row (i only need to update a row)

but then where does DELETE & INSERT comes into then? do i have to delete the row first? then insert new data, then update? opss..i think i'm confused...i only want to inc + 1 to a field. But thanks to the link to the reference. It's really comprehensive!

8:00 pm on Nov 12, 2003 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



slow down ;)

a little list of commonly used mysql commands

So I installed MySQL, what now?

1. Create a database using CREATE DATABASE [mysql.com]

This gives you an empty DB, now what?

2. Create some tables using CREATE TABLE [mysql.com]. If you make a mistake try ALTER TABLE [mysql.com] or DROP TABLE [mysql.com] and make a new one.
(Designing the db is another lesson ;))

So a bunch of empty table in my DB, so what?

Well, the key to a Database is, yes you guessed it, data.

3. Manipulate some data
Get new data in the table
INSERT [mysql.com]

Need to change the data in the table
UPDATE [mysql.com]

Need to remove some data
DELETE [mysql.com]

Want to take a look at some data
SELECT [mysql.com]

These are all fairly standard functions though they can be very complex. Many more...
MySQL Online Manual [mysql.com]

I am a command line type but most people use phpmyadmin for these things and don't always understand right away how much is being done for them.

8:18 pm on Nov 12, 2003 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



>slow down
LOL
Another great post, jatar_k, once again flagged this one for future reference to others.
12:43 pm on Nov 14, 2003 (gmt 0)

10+ Year Member



Ok, i think i get it.. INSERT is to add a new piece of data, while UPDATE changes data.

so from the manual,:

UPDATE [LOW_PRIORITY] [IGNORE] tbl_name [, tbl_name ...]
SET col_name1=expr1 [, col_name2=expr2 ...]
[WHERE where_definition]

This begins to get tougher. I wanted to change the data from 4images_image table, where Image_ID="blah blah" and change the Image_Hit= Image_Hit + 1

so i use this command:

UPDATE 4images_Images SET 4images_Hit=4Images_Hit + 1 WHERE Image_ID="Blah blah";

Am i right guys? Am i right? :)This is actually very interesting. It's kind of nice if you can get it to work. Thank you jatar, you are my man!

1:08 pm on Nov 14, 2003 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I believe you are right, Congratulations! The syntax looks good to me. The only way to find out though is to test it and see ;)
2:25 pm on Nov 14, 2003 (gmt 0)

10+ Year Member



looks good? great! i'm going to test it now. actually, i am afraid to test it out before getting advice from you people, cause i mess up things pretty easy. But thanks for your help guys. I LOVE this forum!
 

Featured Threads

Hot Threads This Week

Hot Threads This Month