Jump to content

[SOLVED] Help Required in some coding!


DarkTerror

Recommended Posts

Friends, How can i make a text box having default text in it. Actually i want that to implement on image pages of my website so that people can have the image codes to post in their forums blogs etc. So I want that the text inside the text box should change according to the image name. For example, see this link

http://www.glowfoto.com/viewimage.php?img=01-041403L&y=2007&m=01&t=jpg&rand=8652&srv=img4 on the bottom of the image page theres a button called "get link codes" which when pressed will redirect to another getcode.php page which shows the different codes in text boxes for the image. (http://www.glowfoto.com/getcode.php?srv=img4&img=01-041403L&t=jpg&rand=8652&m=01&y=2007)

 

I know to create text boxes,text fields having default text but not be able to create the links which changes according to image,i tried using some variable names but it also can't help me.

 

 

 

Please Help!

Link to comment
Share on other sites

do you want like

 

 

<textarea name=html><a href="<?php echo $URL; ?>"><img src="<?php echo $imgurl; ?>" alt="free image hosting" border=0 /></a></textarea>

 

 

Cool man,You Simply Rock!!!

 

Just a little mod to your code and it worked, i just put it something like:

 

<textarea name=html><a href="<?php echo "http://my-site.com/$image";?>
"><img src="<?php echo "http://my-site.com/t_$image"; ?>" alt="free image hosting" border=0 /></a></textarea>

$image and t_$image are the variable names assigned for the image and its thumbnail respectively.The HTML and direct link for the images are working fine. but when I put the BBCode to show something like this:

 

<textarea name=html><?php echo "[url=http://my-site.com/$image][img=http://my-site.com/t_$image][/url]"; ?></textarea>

 

It giving an error like:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING on line 28

 

Can anyone help plzz!!

Link to comment
Share on other sites

22nd Line---><b><font color="#FF0000">DIRECT LINK:</font></b>
23rd Line---><center><textarea name=html cols=100 rows=3><?php echo "http://my-url/folder/image.php?image=$image"; ?></textarea></center>
24th Line--->
25th Line---><br>
26th Line--->
27th Line---><b><font color="#538f00">BBCODE-1</font></b>
28th Line---><center><textarea name=html cols=100 rows=3><?php echo "[url=http://my-url/folder/image.php?image=$image][img=http://my-url/folder/t_$image][/url]"; ?></textarea></center>
29th Line--->
30th Line---><br>
31st Line---><b><font color="#538f00">BBCODE-2</font></b>
32nd Line---><center><textarea name=html cols=100 rows=3><?php echo "[url=http://my-url/folder/image.php?image=$image][img=http://my-url/folder/t_$image][/url]"; ?></textarea></center>

 

Also one more thing, BBCODE-2(Line 31st) is working fine only the problem is with BBCODE-1.

 

Kindly Help!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.