Jump to content

andik

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

andik's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. one.php <? include 'config.php'; $url = 'http://somedomain.com/myfeed.rss'; require_once("process.php"); ?> process.php <?php A bunch of functions that clean the rss feed up are here mysql_query("INSERT IGNORE INTO feed (url, title, description, date, city) VALUES('".$link."', '".$title."', '".$description."', '".$date."', '".$city."' ) ") or die(mysql_error()); ?> So everything works except what I added, which is the $city variable. My workaround is to create individual pages for process and call like this: require_once("processMiami.php"); And then hard code miami in like below in processMiami.php <?php A bunch of functions that clean the rss feed up are here mysql_query("INSERT IGNORE INTO feed (url, title, description, date, city) VALUES('".$link."', '".$title."', '".$description."', '".$date."', 'miami' ) ") or die(mysql_error()); ?> I can ultimately do it this way but wanting to learn how this would normally be done. Hopefully I've posted enough. I removed a ton from a very long script but I think this is the meat of what you were asking for.
  2. Please forgive my limited knowledge of php. I am trying to pass a variable from 1 page to the next. I have SCRIPT A (I didn't write it) that parses an rss feed and then calls SCRIPT B to insert it into a database. Everything works great.. and all I'm trying to do is add a new piece of information. In my db, I added a column called 'city'. There are currently 25 different SCRIPT A's (25 different city names). I could create 25 SCRIPT Bs and call them individually, but I'm trying to use 1 SCRIPT B and just send the city name. I've read about POST and GET but still not sure on this? Can't I just hard code my city name into each SCRIPT A like this: $city = "miami"; And then put this at the top of SCRIPT B? $city = $_GET['city']; Well.. apparently, I can't because that doesn't work. Again.. sorry for the dumb question. It's my first time attempting anything with php. Thanks.
×
×
  • 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.