Jump to content

weirddddd!!!!!!


ohdang888

Recommended Posts

i'm passing html via the url...

 

so i have something like this:

<?php
$code = "<center> blah blah blah";
$code = urlencode($code);
echo "<a href='index.php?code=".$code."'>Go</a> ";
?>

 

and on index.php i  store urldecode($_GET['code']); in a databse

 

it works fine, but i found a really weird error. After long trail and error and testing strlen($code), i discovered that the process only works if the $code is 512 characters or less. After that, it doesn't work. it doesn't store ANYTHING in the database. No errors, everything says its working, but its not. Once it gets to 513 characters or more, just stops.

 

My table field i'm inserting it into is a LONGTEXT, which can store 4 trillion bytes, so that's obviously not the issue.

 

Any ideas?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/154818-weirddddd/
Share on other sites

hmmmmmmmm

 

i'm slightly confused as to how to do this then....

 

I'm building a simple application platform. The app has to pass html to me, and i'm using: simplexml_load_file($api_url.$string);

 

Facebook platform has a similar function that passes sometimes large amounts of html to the api. How would this be done over post?

 

I know i could use cURL, but then i don't get the quick xml set up from simplexml_load_file

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/154818-weirddddd/#findComment-814236
Share on other sites

The code might be 500 some characters, but when converted with urlencode, plus the url thats already there, it probably extends past the urls limit.

 

For POST:

 

<form method="POST" action="Location.php"><input type="hidden" name="code" value="<?=$code;?>"><a href="index.php" onClick="form.submit();">Go</a></form>

 

I don't remember if form.submit() will work or not because javascript is very useful but annoyingly hard to remember to me. If it doesn't work, just look up the submit function lol. Your recieving form will have to check the $_POST instead of $_GET

Link to comment
https://forums.phpfreaks.com/topic/154818-weirddddd/#findComment-814237
Share on other sites

Why?

Javascript is awesome.

 

because its awesome, but easy to f*** up my page with it if apps use it.

 

I'm trying to figure out how facebook and opensocial do their javascript and css, but its way beyond my level

(they add "app_'app_id' " infront of all ids and classes in the html of the app, and add the similar thing to all javscript and css. Its quote confusing to figure out how they do it )

 

 

I think i might just use cURL...

Link to comment
https://forums.phpfreaks.com/topic/154818-weirddddd/#findComment-815144
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.