Jump to content

Add <?php Echo $_get["q"]; ?> In My Php Code


bondigor69

Recommended Posts

1. If the "q" is set then use it, otherwise use a default value.

2. Validate it. It should be one of "news" or whatever else is valid for that feed. If it's not valid then do something besides ignore the problem.

3. Stick it in the string. There are many ways to do this and if you know even the smallest amount of PHP then you can do it.

Link to comment
https://forums.phpfreaks.com/topic/273409-add-in-my-php-code/#findComment-1407183
Share on other sites

Hey dude, give this a try:

<?php

$_GET['q'] = (isset($_GET['q'])) ? $_GET['q'] : "some_default_value";

$rss->load("http://wordpress.org/{$_GET['q']}/feeds/");

?>

 

Let me know how you get on.

 

Regards,

 

L2c.

yeahhhhh man you're amazing. thank you so much it works fine for me

Link to comment
https://forums.phpfreaks.com/topic/273409-add-in-my-php-code/#findComment-1407189
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.