|
Posted by emmakane on 01/01/06 23:52
Yes, this is exactly what I need, I am obviously being really stupid,
but it is not the finding of such commands is the implemetation of
them. This example on the page you referenced is obviously intended to
be really helpful
Example 1. urlencode() example
<?php
echo '<a href="mycgi?foo=', urlencode($userinput), '">';
?>
But I don't get how to implement it at all and thats whats doing my
head in. Adding what I think this means to my script e.g
<?
require "config.php"; // All database details will be
included here
$page_name="test.php"; //
$query="SELECT name FROM database1 ";
$result=mysql_query($query);
echo mysql_error();
while($get = mysql_fetch_array($result))
{
echo '<a
href=http://www.myurl.com/search.php?q=$get[name]&Search=Search>$get[name]<br>',
urlencode($get[name]), '">';
}
?>
fails as I clearly don't understand what to do with the variable -
should this be on $get or $results, does it need to be a new variable i
reference from that line on - this is where I get totally confused and
none of the examples I can find or that are on this page clarify for
this me one little bit.
Could someone just show me exactly how to use this function? I'm stuck
on this and can't move on. Everything I try fails in an error.
Navigation:
[Reply to this message]
|