Jump to content

shadowmonk

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Everything posted by shadowmonk

  1. I could see the benefit of using parse_str() in other situations, but in this case using the explode() function allows me to keep the same link for multiple uses rather than just once. I might end up using it though, depending on how the project progresses.
  2. the $_SEVER['QUERY_STRING'] works, I just needed to explode it into an array so I don't keep adding the same variable onto it every time it's clicked. I think I'm going to leave this open for a little bit, just in case I have any more questions related to this.
  3. I had this happen recently, you could try doing an absolute link. Then, once you verify it's working you can migrate to the relative if you really need to. You might also make sure the folder has write permissions.
  4. I don't think urlencode() will work, based on how I'm understanding the documentation and examples. Let me try to clarify my problem with examples- say my link is already: http://mysite.com/script.php?var=rand What I'm trying to do is using a link within the page to append "&var2=foobar" If I use the php_self I just get: http://mysite.com/script.php&var2=foobar If I use # in the href it's: http://mysite.com/script.php?var=rand#&var2=foobar The # is close, but it is looking for a link titled "&var2=foobar" somewhere on the page instead of passing it to the script as a variable. I was thinking the javascript this.href might work, but I can't figure out how to get it to work.
  5. Hi, I know there is another thread on here that is along these lines, but this one is different, trust me. I have a link that is already passing variables, my problem is trying to add onto the link. If i use the $_SERVER['PHP_SELF'] variable I only get up to the filename. If I use the # sign in the href tag I get the whole link, but I can't append a variable to it. Is this possible or do I need to create multiple links based on what variables are present?
  6. no problem, it actually gave me faith in these forums. Tried some others and... well I don't go back to those anymore.
  7. the config.php file is included in the header of the recent_news.php page. I included the entire function code in my second post, and haven't changed it since. I guess my next avenue is the placeholder route, this should be fun... Thanks for the help.
  8. I might be a beginner at php, but thankfully I put the actual function in the config.php file for the page. Like I said, I figured that trying to call the function when loading the database information wouldn't work, but I wanted to try it anyway. Is there a way that when I submit the form that uploads the information to the database I can replace a place holder with what I want it to actually put into the database. I'm only looking for an easy way around the image code because each image also has footer text. It's actually a two row table that has the image up top and a footer underneath it that is unique for each picture.
  9. [quote author=jesirose link=topic=121585.msg500234#msg500234 date=1168305381] Is the image() function included on the page? You have to have it on the page you're running in order to call it. [/quote] Thats what I was afraid of. No, the function is actually in the database itself. I was trying to have it call the function when it loaded the database article, because thats how I would have preferred it to be done, but I was pretty sure it wasn't going to work that way.
  10. [quote author=jesirose link=topic=121585.msg500225#msg500225 date=1168304968] You need to have it in PHP tags. <?=image()?> (works with short tags on, otherwise use <?php echo image(); ?>) You can't just write it and expect the computer to guess what is php. :-P [/quote] Ok, I tried it both ways. Now it just doesn't show anything there... any other ideas?
  11. sorry. All I did was place image() in the database before the "Testing" so it looks like this "image()<p>Testing, 1. 2.. 3...</p>" in the database. I did forget the semicolon, but it didn't change anything, just added a semicolon after image(). magic2goodil (and jesirose if I'm still wrong above) - all recent_news.php does is get the information from the database: [code] <?   mysql_select_db($database, $connection) or die('Database Not Found');   $query = "SELECT pmma_active.title,                             pmma_active.article                   FROM  pmma_active                 WHERE  pmma_active.id = $article";   $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());   while(list($title, $article, $id) = mysql_fetch_row($result))   {       echo "<h3>$title</h3>";       echo "$article";       echo "<hr />";   } ?> [/code]
  12. This is the direct link to the test article http://presbyterianmanors.org/2007/news/recent_news.php?article=2 The function I'm trying to call is simple: [code] function image() {   echo "Hello world"; } [/code] Instead i'm just getting "image()" in the text.
  13. This is going to be hard to explain, but I'm going to give it a try. I'm trying to create a news database for a site my company is re-designing. Sometimes they have pictures that go along with their articles, so we need to post them with the article. I've got it built so it can upload the pictures to the server and will store the location in the database. I'm wanting to create a function that can automatically insert the necessary code, with the proper source name from the database, into the article where ever I need it and be able to define the alignment. This is where I think I'm stuck. The function is going to be stored in the sites config file, however, I'm trying to call the function on-the-fly when I load the article from the database. This means I'm trying to call the function when I load it from the database, with values that are stored in the database. This I should be able to do after I define variables, but first I need to get just a basic function working this way. The basic function I'm experimenting with just displays "Hello World" when called, but when I load the article it just shows the function "image()". Is it at all possible to do what I'm trying? If not, is there anyway to have it insert the text I need when it updates the database? If neither of these is possible, is there anything else I could do that wouldn't require me having to past the image code directly into the upload form? Thanks for any help I can get.
×
×
  • 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.