GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 23-Aug-2003, 01:35
dbztoolkit
 
Posts: n/a

php link


im trying to make a link catch some data form a form and post this is the best i can come up with
PHP Code:

<? $pid = link("$HTTP_POST_VARS['name']"); 

echo($pid);
  ?>


cant get this to work the error message i get

Warning: Wrong parameter count for link() in /home/sites/site15/web/pmsg2.php on line 101
  #2  
Old 23-Aug-2003, 08:42
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
What are you trying to do?

Whatever you're using it for, you're supposed to give it 2 string values. e.g. $result = link( '/target', '/link' );

I personally have not used this particular function since it doesn't seem to be supported in the version of PHP (for Windows) that I use.

BTW, it's preferred that you use $_POST['name'] instead of $HTTP_POST_VARS['name'] if you're using the latest version of PHP (i.e. 4.2+).
  #3  
Old 23-Aug-2003, 09:06
dbztoolkit
 
Posts: n/a

i need


what i need it to do is if someone types in sesilva that will send the message to sesilva.txt i need it to add a link at the buttom saying view msg here and it will link to whatever they typed .txt
like sesilva will send them to sesilva.txt i hope i said this so you can under stanmd what im saying
  #4  
Old 23-Aug-2003, 09:32
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

Custom make_link() function in PHP


Oh I see...

Perhaps this is something you can try to work on:
PHP Code:

<?php
// START OF CUSTOM FUNCTIONS
function make_link( $url, $title, $target='' )
{
  $target = ( empty($target) ? '' : ' target="'.$target.'"' );
  return( '<a href="'.$url.'"'.$target.'>'.$title.'</a>' );
}

function make_link_msg( $filename )
{
  $filename = strip_tags( $filename );
  return( make_link($filename.'.txt', 'View Message Here', '_blank') );
}
// END OF CUSTOM FUNCTIONS


// So now, we can create the link from our $_POST['name']
// assuming $_POST['name'] == 'desilva'
echo make_link_msg( $_POST['name'] );
// should output:
// <a href="desilva.txt" target="_blank">View Message Here</a>
?>

  #5  
Old 23-Aug-2003, 09:40
dbztoolkit
 
Posts: n/a

i dont need it to be already set to a file


what i need it to do is if someone types in sesilva that will send the message to sesilva.txt i need it to add a link at the buttom saying view msg here and it will link to whatever they typed .txt
like sesilva will send them to sesilva.txt i hope i said this so you can under stanmd what im saying

never worked with links befor in php

this is the best i can come up with

i get a error message

PHP Code:

<? link($HTTP_POST_VARS['name'] . '.txt'); ?>


Wrong parameter count for link() in
 

Recent GIDBlogLast Week of IA Training by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Optimizing your web server with Turck MMCache for PHP JdS Web Hosting Forum 2 07-Jan-2004 07:48
apache2 - php cgi fehler - schleife inna Apache Web Server Forum 8 27-Nov-2003 09:55
[Linux] Installing PHP --with-mcrypt JdS Web Hosting Forum 0 20-Aug-2003 08:40
All the big PHP script collections that matter jrobbio MySQL / PHP Forum 5 06-Jun-2003 16:14
Top 10 PHP sites according to alexa jrobbio MySQL / PHP Forum 0 03-Jun-2003 03:36

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 03:13.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.