homepage Welcome to WebmasterWorld Guest from 54.198.25.229
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
The content received from the origin server was too large!
when using redirection with php on WAP
expert_21

10+ Year Member



 
Msg#: 2051 posted 6:12 pm on Nov 11, 2003 (gmt 0)

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.

 

expert_21

10+ Year Member



 
Msg#: 2051 posted 6:41 pm on Nov 11, 2003 (gmt 0)

by the way, the file is only 5 kb. :(

expert_21

10+ Year Member



 
Msg#: 2051 posted 12:38 am on Nov 12, 2003 (gmt 0)

anyone, please please please help me out?

jatar_k

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



 
Msg#: 2051 posted 12:59 am on Nov 12, 2003 (gmt 0)

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?

expert_21

10+ Year Member



 
Msg#: 2051 posted 7:13 am on Nov 12, 2003 (gmt 0)

@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 :(

expert_21

10+ Year Member



 
Msg#: 2051 posted 1:19 pm on Nov 12, 2003 (gmt 0)

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!

coopster

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



 
Msg#: 2051 posted 1:44 pm on Nov 12, 2003 (gmt 0)

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 ;)

expert_21

10+ Year Member



 
Msg#: 2051 posted 7:41 pm on Nov 12, 2003 (gmt 0)

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!

jatar_k

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



 
Msg#: 2051 posted 8:00 pm on Nov 12, 2003 (gmt 0)

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.

coopster

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



 
Msg#: 2051 posted 8:18 pm on Nov 12, 2003 (gmt 0)

>slow down
LOL
Another great post, jatar_k, once again flagged this one for future reference to others.

expert_21

10+ Year Member



 
Msg#: 2051 posted 12:43 pm on Nov 14, 2003 (gmt 0)

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!

coopster

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



 
Msg#: 2051 posted 1:08 pm on Nov 14, 2003 (gmt 0)

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 ;)

expert_21

10+ Year Member



 
Msg#: 2051 posted 2:25 pm on Nov 14, 2003 (gmt 0)

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!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved