Is this madness a mefford or called a function ?
`
<form action="ScoreCardAlpha.php" method="post">
A: <input type="text" name="$X" />
B: <input type="text" name="$Z" />
C: <input type="text" name="$W" />
// read input data on $W , $X and check to see if (it or they{1,2,3 and byond}) has http// if so save after //
// check all data for hacks.
<input type="play$" />
` is thats what is known as a funcion or do i have to find a method or use an areay ? if so could you point me to an easy to translate guide, thanks.
` call scenario $123/45/9 {the pink n yellow whole in the ground started to form a bridge
Kniggles
Junior Poster in Training
57 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
<?php
<form action="ScoreCardAlpha.php" method="post">
A: <input type="text" name="$X" />
B: <input type="text" name="$Z" />
C: <input type="text" name="$W" />
// read input data on $W , $X or $Z has http// if so save after //
if(!filter_has_var(INPUT_post, "$X"))
{
// if true
**** deleate all char upto and including // then post to "$X" ****
echo("Input has been adapted and saved");
}
else
{
// if false
**** post to "$X" ****
echo("Input did not need adapting and has been saved");
}
<input type="submit" />
?>
Kniggles
Junior Poster in Training
57 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
if(!filter_has_var(INPUT_POST, "$X"))
What are you trying to do, I don't understand:
is thats what is known as a funcion or do i have to find a method or use an areay ? if so could you point me to an easy to translate guide, thanks.
call scenario $123/45/9 {the pink n yellow whole in the ground started to form a bridge
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
if(!filter_has_var(INPUT_POST, "$X"))
What are you trying to do, I don't understand:
I have a box to input an image url,
form 1 =
" URL: <input type="text" name="url" /> "
-----------------------------
process form =
$sql="INSERT INTO table1( url )
VALUES
('$_POST[url]')";
--------------------------------
output form =
echo "<td><img width = '75' src='http://". $row['url'] . "' /></td>";
------------------------------------------------
this however ends up with a broken link unless the ' http:// ' is not input. {thus i am trying to filter out the http:// and any bad code at the same time.
Also i am trying to make the image clickable.
Kniggles
Junior Poster in Training
57 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
Maybe I am missing something, but I don't see how the code you provided can even execute. You should get a parse error as soon as it gets to the "<" in <form action="ScoreCardAlpha.php" method="post">
that part was put in for my mental notes, the part i know that needs the fix is
echo "<td><img width = '75' src='http://". $row['url'] . "' /></td>";
I can get the pics up and displayed in a 75 box, so long as you dont copy the http:// part.
this is silly az to get the image url its easy to copy n paste it,
also when the pic is pisplayed its not clickabale.
so therefor its either something in the upload script or output script that needs to be changed.
Kniggles
Junior Poster in Training
57 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
if(!filter_has_var(INPUT_POST, "$X"))
What are you trying to do, I don't understand:
sumting like that,
\\ this line reads input and surches to see if http:// is added
$var= {" `any char` `any char` {loop untill . "http://"} "}
if ($input_post){ = includes} $var
\\ this line deleats every thing before http://
then $X = everything after $var
else
$X = $input_post
or
\\ this only outputs a image if http:// is not in the post form allready.
echo "<td><img width = '75' src='http://". $row['url'] . "' /></td>";
Kniggles
Junior Poster in Training
57 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
If you're just trying to delete 'http://' from a string, there are easier methods. mschroeder has outlined a nice one. I'd use str_replace myself:
$url = str_replace("http://","",$url);
It's not pretty, but should work. It replaces "http://" with a 'nothing'.
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
That's a fair point ms - that's why I said it was a dirty fix. And yes, I agree, the 'i' version would be better.
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
Now have image and a link displayed in a table,
am now trying to make the image clickable to the ['website'] link
echo "<td><a class=\"mylink\" 'http://' href=\"http://" . $row['website'] . "\">" . $row['website'] . "</a></td>";
echo "<td><img width = '75' src=". $row['url'] . " /></td>";
have been trying mschroeder
echo "<td><a href="someurl.com"><img width = '75' src='http://". $row['url'] . "' /></a></td>";
like
echo "<td><a href="$row['website']"><img width = '75' src=". $row['url'] . " /></a></td>";
anyone see where i am messing it up please?
Kniggles
Junior Poster in Training
57 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
Kniggles
Junior Poster in Training
57 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
Also unless you absolutely NEED to append the strings together, passing multiple strings and delimiting them with a comma will speed things up. This only works with echo and not print.[/QUOTE]
have got that , and it works,
still have not got the image clickable to the ['website'] link,
Kniggles
Junior Poster in Training
57 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0