Be a Supporter!

php questions

  • 537 Views
  • 7 Replies
New Topic Respond to this Topic
onlyproductions
onlyproductions
  • Member since: Oct. 30, 2005
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
php questions 2006-12-03 10:43:23 Reply

1 how do u mak a text box that the user can write on
2 how do u assign spiecific functions to a button so it is't just a link. for instance whn you whould click on a button a counter would go up by one
3 im loading text form a txt file to a text box how do u make it so that there is a seperate scroll bar on the text box

it doesnt matter if you can answer one or all of the questions

bi


.

BBS Signature
Zendra
Zendra
  • Member since: Sep. 7, 2003
  • Offline.
Forum Stats
Member
Level 51
Blank Slate
Response to php questions 2006-12-03 10:50:20 Reply

At 12/3/06 10:43 AM, onlyproductions wrote: 1 how do u mak a text box that the user can write on

http://www.w3schools.com/html/html_forms.asp

2 how do u assign spiecific functions to a button so it is't just a link. for instance whn you whould click on a button a counter would go up by one

<input type="button" name="NAME IT" value="NAME IT" onClick="DO ACTION">
Note that the onClick function is JavaScript and a Javascript function should be specified there. Example: document.location: URL

3 im loading text form a txt file to a text box how do u make it so that there is a seperate scroll bar on the text box

Use a text area for that.

it doesnt matter if you can answer one or all of the questions

Think I just did.

blah569
blah569
  • Member since: Jan. 18, 2005
  • Offline.
Forum Stats
Member
Level 25
Programmer
Response to php questions 2006-12-03 10:51:36 Reply

At 12/3/06 10:43 AM, onlyproductions wrote: 1 how do u mak a text box that the user can write on

That is not php... but here: <input type='textarea' col='10'> Sorry if I am wrong, if I am... Google it.

2 how do u assign spiecific functions to a button so it is't just a link. for instance whn you

whould click on a button a counter would go up by one
if($_POST['formpost']{
$variable = $_POST['var'];
$variable = $variable + 1
}else{?>
<form name='formpost' method='post'>
<input type='text' name='var'><BR>
<form type='submit' value='Submit'>
<?}?>

3 im loading text form a txt file to a text box how do u make it so that there is a seperate scroll bar on the text box

That will automatically happen with a html text area. If you are using javascript, in your string you should have scrollbars=true.


it doesnt matter if you can answer one or all of the questions

bi

I hope I could help... if my php did not work... Tell me and I will fix it.


BBS Signature
Zendra
Zendra
  • Member since: Sep. 7, 2003
  • Offline.
Forum Stats
Member
Level 51
Blank Slate
Response to php questions 2006-12-03 10:59:47 Reply

At 12/3/06 10:51 AM, blah569 wrote: I hope I could help... if my php did not work... Tell me and I will fix it.

It does not work. There are multiple errors in there - around five programming mistakes which would definitively didn't make it work. Simply writing the code in the NG BBS message area requires the necessary programming skills. Better use a PHP editor next time.

Here's an improved version:

<?PHP

if ( isset($_POST['formpost']) )
{

$variable = ( isset($_POST['var']) + 1 );
echo $variable;
exit;
}

else
{
?>
<form name="formpost" method="post">
<input type="text" name="var"><BR>
<input type="submit" value="Submit">
</form>
<?PHP

}

?>

blah569
blah569
  • Member since: Jan. 18, 2005
  • Offline.
Forum Stats
Member
Level 25
Programmer
Response to php questions 2006-12-03 11:18:25 Reply

At 12/3/06 10:59 AM, Zendra wrote:
At 12/3/06 10:51 AM, blah569 wrote: I hope I could help... if my php did not work... Tell me and I will fix it.
It does not work. There are multiple errors in there - around five programming mistakes which

It may be messy programming, but that script works for me.


BBS Signature
Zendra
Zendra
  • Member since: Sep. 7, 2003
  • Offline.
Forum Stats
Member
Level 51
Blank Slate
Response to php questions 2006-12-03 11:33:21 Reply

At 12/3/06 11:18 AM, blah569 wrote: It may be messy programming, but that script works for me.

No, it will not.

Your code further explained:

Error: Where the <?PHP-tag?
if($_POST['formpost']{ Error: Missing ")" - PHP returns error
$variable = $_POST['var'];
$variable = $variable + 1 Error: Missing ";" - PHP returns error
}else{?>
<form name='formpost' method='post'>
<input type='text' name='var'><BR>
<form type='submit' value='Submit'> Error: Form should be input
Error: Missing </form> tag.
<?}?>

Hope that explains some things. :)

blah569
blah569
  • Member since: Jan. 18, 2005
  • Offline.
Forum Stats
Member
Level 25
Programmer
Response to php questions 2006-12-03 16:17:05 Reply

Sorry... I didn't proof my code. Even when my code works, it can be messy... but people normally understand what it does.


BBS Signature
Zendra
Zendra
  • Member since: Sep. 7, 2003
  • Offline.
Forum Stats
Member
Level 51
Blank Slate
Response to php questions 2006-12-04 03:19:36 Reply

At 12/3/06 04:17 PM, blah569 wrote: Sorry... I didn't proof my code. Even when my code works, it can be messy... but people normally understand what it does.

That's a bit naive, to think like that. Submitting a messy code where you're not even sure it works is a lazy idea. You don't prove anything.