smarty分配功能如何工作?

The code inside an HTML file is like this:

{assign var="url" value="/?user&q=code/approve/myapp"}

when loading page, the server returns error code 500.

{assign var="url" value="/?user&q=code/approve/myapp"}

It is throwing you the 500 error because your php cannot process the request. You need to have $_GET function to get those values and most importantly your code should be

{assign var="url" value="somefile.php?user&q=code/approve/myapp"}

You can't end it with / and start immediately with ?

Example

This will output JSON Data

http://api.openweathermap.org/data/2.5/weather?q=London,uk

This will throw error

http://api.openweathermap.org/data/2.5/?q=London,uk