[PHP] Limiting character input in textarea
Unlike the input fields that use maxlength to define the number of character allowed. Textarea doesnt seem to have that capability. I want to limit the number of character to 255. IS there any way of doing this without having to break my neck about it? Garth -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] copy function?
I have a button which I want to add a function to, so that when it is clicked, the data from one textarea will be copied to another textarea Which event handler of the button should I use and hoe should I construct the function? Garth -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] From: mail() function
I am using the normal mail() function and currently using the from address as: mail($HTTP_POST_VARS['emailaddress1'], 'Matchmakers Website Registration' , $registree_email_text, 'from:[EMAIL PROTECTED]'); how can I make the from address look like Matchmakers Team instead of 'from:[EMAIL PROTECTED]'. Regards Garth -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php mail() error
Im using the php mail() function to try send an email to a user that has just registered. mail($HTTP_POST_VARS['emailaddress1'], 'Matchmakers Website Registration' , 'Welcome'); But when I get the following error back.: Warning: mail(): SMTP server response: 550 5.7.1 Unable to relay for [EMAIL PROTECTED] Can someone help me out, by telling me what it means or what Im doing wrong? Thanx Garth -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] using mysql in php problem
I have created a registration page http://www26a.your-server.co.za/matchm/registration4.php On this page I have many fields, some of them pulling data out from my database. I have a javascript validation scipt thats checks on submission of the form to see if all required fields are filled in correctly. IF thats the case it should submit the form. Which it isnt doing! It should start with submission after the validation check is passed. Then I check to see whether the BusinessName BusinessOwner already exist, if not then I am trying to to an insert (which it doesnt do either). Here is the php code: $errmsg = ; $business_query = SELECT BusinessName, BusinessOwner from business WHERE BusinessName = '$BusinessName' AND BusinessOwner = '$BusinessOwner' ; $result = mysql_query($business_query); if (mysql_num_rows($result) 0) {$errmsg .= You are already registered at Match Makers;} else { if (isset($submit) == Register Now){mysql_query(INSERT INTO business (BusinessName, BusinessOwner, StreetAdress, Suburb, CityTown, ProvinceID, StreetCode, PostalAddress, PostalCode, WebsiteAddress, IndustryID, IndustryOther, ProductService, BusinessAge, AnnualTurnoverID, EmpowermentProfileID, BEEScoreCardID, PreferredLocationID, PreferredProductService, PreferredMatchPartner, PreferredIndustryID, PreferredIndustryOther, PreferredAgeID, PreferredTurnoverID, PreferredEmpowermentProfileID, DateRegistered, MarketSourceID) VALUES (' . $HTTP_POST_VARS['business_name'] . ', ' . $HTTP_POST_VARS['street_address'] . ', ' . $HTTP_POST_VARS['suburb'] . ', $city_town, $province_desc, $street_code, $postal_address, $postal_code, $website_address, $industry_desc, $industry_other, $product_service, $business_age, '', '', '', '', '', '', '', '', '', '',)); $id = mysql_insert_id(); if ($telnumber1 '') {mysql_query(INSERT INTO business_communication (BusinessID,CommunicationType,Destination) VALUES ( ' . $id . ', 1, '. $HTTP_POST_VARS['telnumber1'] . '));} if ($faxnumber1 '') {mysql_query(INSERT INTO business_communication (BusinessID,CommunicationType,Destination) VALUES ( ' . $id . ', 2, '. $HTTP_POST_VARS['faxnumber1'] . '));} if ($cellnumber1 '') {mysql_query(INSERT INTO business_communication (BusinessID,CommunicationType,Destination) VALUES ( ' . $id . ', 3, '. $HTTP_POST_VARS['cellnumber1'] . '));} if ($emailaddress1 '') {mysql_query(INSERT INTO business_communication (BusinessID,CommunicationType,Destination) VALUES ( ' . $id . ', 4, '. $HTTP_POST_VARS['emailaddress1'] . '));} echo Your registration has been submitted; } } I am not sure where exactly I am going so wrong, and it really is starting to drive me crazy! Regards Garth -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help needed on php/mysql
=contentIndustry:/td td width=55% select class=content name=industry_desc id=selectoption value=-- select one --/option ?PHP for($x=0;$x$number_industry;$x++) { echo('option value='.$rijindustry[$x][IndustryID].''); echo(''.$rijindustry[$x][Description].'/option'); } ? /select /tr tr td width=45% align=right class=contentIndustry Other:/td td width=55%input class=content type=text size=35 maxlength=100 name=industry_other/td /tr tr td width=45% align=right class=contentBusiness Age (Years):/td td width=55%input class=content size=5 maxlength=4 type=text name=business_age/td /tr tr td width=45% align=right class=contentAnnual Turnover:/td td width=55% select class=content name=ann_turn_desc id=selectoption value=-- select one --/option ?PHP for($x=0;$x$number_ann_turn;$x++) { echo('option value='.$rijann_turn[$x][AnnualTurnoverID].''); echo(''.$rijann_turn[$x][Description].'/option'); } ? /select /tr tr td width=45% align=right class=contentEmpowerment Profile:/td td width=55% select class=content name=empower_prof_desc id=selectoption value=-- select one --/option ?PHP for($x=0;$x$number_empower;$x++) { echo('option value='.$rijempower[$x][EmpowermentProfileID].''); echo(''.$rijempower[$x][Description].'/option'); } ? /select /tr tr td width=45% align=right class=contentBEE Score Card:/td td width=55% select class=content name=scorecard_desc id=selectoption value=-- select one --/option ?PHP for($x=0;$x$number_scorecard;$x++) { echo('option value='.$rijscorecard[$x][BEEScoreCardID].''); echo(''.$rijscorecard[$x][Description].'/option'); } ? /select /tr /table /td /tr tr td class=formAreaTitle.: Preferred Partner Information/td /tr tr td class=main width=60% table border=0 width=100% cellspacing=4 cellpadding=0 class=formArea tr td width=45% align=right class=contentPreferred Product Service:/td td width=55%textarea rows=5 cols=35 class=content maxlength=255 type=text name=preferred_product_service/textarea/td /tr tr td width=45% align=right class=contentPreferred Match Partner:/td td width=55%textarea rows=5 cols=35 class=content maxlength=255 type=text name=preferred_match_partner/textarea/td /tr tr td width=45% align=right class=contentPreferred Location:/td td width=55% select class=content name=prefer_location_desc id=selectoption value=-- select one --/option ?PHP for($x=0;$x$number_provinces;$x++) { echo('option value='.$rijprovinces[$x][ProvinceID].''); echo(''.$rijprovinces[$x][Description].'/option'); } ? /select /tr tr td width=45% align=right class=contentPreferred Age:/td td width=55% select class=content name=prefer_age_desc id=selectoption value=-- select one --/option ?PHP for($x=0;$x$number_age;$x++) { echo('option value='.$rij_age[$x][AgeID].''); echo(''.$rij_age[$x][Description].'/option'); } ? /select /tr tr td width=45% align=right class=contentPreferred Annual Turnover:/td td width=55% select class=content name=prefer_turnover_desc id=selectoption value=-- select one --/option ?PHP for($x=0;$x$number_pref_turnover;$x++) { echo('option value='.$rij_pref_turnover[$x][PreferredAnnualTurnoverID].''); echo(''.$rij_pref_turnover[$x][Description].'/option'); } ? /select /tr tr td width=45% align=right class=contentPreferred Empowerment Profile:/td td width=55% select class=content name=prefer_empower_desc id=selectoption value=-- select one --/option ?PHP for($x=0;$x$number_pref_empower;$x++) { echo('option value='.$rij_pref_empower[$x][PreferredEmpowermentProfileID].''); echo(''.$rij_pref_empower[$x][Description].'/option'); } ? /select /tr tr td width=45% align=right class=contentMarket Source:/td td width=55% select class=content name=prefer_turnover_desc id=selectoption value=-- select one --/option ?PHP for($x=0;$x$number_market_source;$x++) { echo('option value='.$rij_market_source[$x][PreferredAnnualTurnoverID].''); echo(''.$rij_market_source[$x][Description].'/option'); } ? /select /tr /table tr td align=rightinput type=submit name=submit value=Register Now/td /tr /td td width=60% /td tr /tr /form /table/td tdtable width=35% /table/td /tr /table /td td width=15nbsp;/td /tr /table !-- body_eof //-- !-- footer //-- ?php require('includes/footer.php'); ? !-- footer_eof //-- /body /html ?php ? Seeing the page might help. On Nov 1, 2004, at 2:52 AM, Garth Hapgood - Strickland wrote: I have written a registration page in php and have a number of edit boxes and drop-down lists. The lists are pulling data out of their respective tables, whereas the edit boxes are just for saving data. Now my main table where all my data is being saved is called Business. Onto this I have a table called BusinessCommunication which has the fields
Re: [PHP] Help needed on php/mysql {Scanned}
As you can see from my code, I do want to check if all mandatory fields are selected or filled in. As well as the issue of the communicationtyes. SO far I do not have fields or anything for the user to use, to select the different CommunicationTypes he wants. I am not sure how to go about this because, there is the issue that more than one Destination can be added for a single CommType. And the number of CommTypes is not fixed and could vary, so thats why Im not sure how much input fields etc to put on page. Does this make sense. Garth Hmmm...I'm not sure I'm following you. You just want to know how to deal with multiple drop down lists? Or do you want to be able to check and make sure all the mandatory selections have been chosen? -dg http://www.rexruff.com On Nov 2, 2004, at 4:58 AM, Garth Hapgood - Strickland wrote: Well my page doesnt have any of the spoken about elements on it yet, because I am not clear as to go about it. The fields I speak of are things that need to be added extra to my page. Here is my pages code so far... ?php require('includes/application_top.php'); require('registration_globals.php'); require('includes/form_check.js.php'); ? !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleMatchmakers - empowerment opportunities network/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 link href=style.css rel=stylesheet type=text/css script language=JavaScript type=text/JavaScript !-- function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d .MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; ia.length; i++) if (a[i].indexOf(#)!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } !-- Hide from old browsers function error_popup() { newwin = window.open(error_popup.php,sss,height=470,width=450) } // end hiding -- //-- /script /head body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 !-- header //-- ?php require('includes/header.php'); ? !-- header_eof //-- !-- body //-- table width=100% border=0 cellspacing=2 cellpadding=5 background=images/page_bg.gif tr td valign=toptable width=130 tr td width=120 align=right class=pagetitlebrregistrationimg src=images/register_image.gif/td /tr /table/td td table width=100% border=0 cellpadding=0 cellspacing=0 tr valign=top pbrbrbFill in all the fields below correct and accurately, then click Register Now./bbrbr /tr tr tdtable width=65% form title=register method=post onsubmit=return check_form(); ?php if (isset($submit) $submit == Register Now){ if (strlen($business_name) == 0) {} else if (strlen($business_owner) == 0) {} else if (strlen($street_address) == 0) {} else if (strlen($suburb) == 0) {} else if (strlen($city_town) == 0) {} else if (strlen($province_desc) == 0) {} $email_popup(); (the code i was trying to use to call popup window) } else { $insertquery = INSERT INTO business (BusinessName, BusinessOwner, StreetAdress, Suburb, CityTown, ProvinceID, StreetCode, PostalAddress, PostalCode, WebsiteAddress, IndustryID, IndustryOther, BusinessAge, AnnualTurnoverID, EmpowermentProfileID, BEEScoreCardID, PreferredLocationID, PreferredProductService, PreferredMatchPartner, PreferredAgeID, PreferredTurnoverID, PreferredEmpowermentProfileID, DateRegistered, MarketSourceID) VALUES ($business_name, $business_owner, $street_address, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',); echo Your registration has been submitted; } ? tr td class=formAreaTitle.: Business Contact Details/td /tr tr td class=main table border=0 width=100% cellspacing=4 cellpadding=0 class=formArea tr td width=45% align=right class=contentBusiness Name:/td td width=55%input class=content type=text size=35 maxlength=100 name=business_name/td /tr tr td width=45% align=right class=contentBusiness Owner:/td td width=55%input class=content type=text size=35 maxlength=100 name=business_owner/td /tr tr td width=45% align=right class=contentStreet Address:/td td width=55%input class=content type=text size=35 maxlength=100 name=street_address/td /tr tr td width=45% align=right class=contentSuburb:/td td width=55%input class=content type=text size=35 maxlength=100 name=suburb/td /tr tr td width=45% align=right class=contentCity/Town:/td td width=55%input class=content type=text size=35 maxlength=100 name=city_town/td /tr tr td width=45% align=right class=contentProvince:/td td width=55% select class=content name=province_desc id=selectoption
[PHP] Help needed on php/mysql
I have written a registration page in php and have a number of edit boxes and drop-down lists. The lists are pulling data out of their respective tables, whereas the edit boxes are just for saving data. Now my main table where all my data is being saved is called Business. Onto this I have a table called BusinessCommunication which has the fields (BusinessCommunicationID, BusinessID, CommunicationTypeID, Destination). BusinessCommunicationID = Primary Key BusinessID = Foreign key from Business Table CommunicationTypeID = Foreign key from CommunicationType table (lists all communication types) Destination = field where data is stored (tel number, email address or fax number etc) Now the problem is that I want the person registering to be able to select the Communication Type/s he wants to add and then be able to enter the relevant information for each selected CommType. There must also be ability to add 2 of the same CommType. How can I achieve this as simply and affective as possible on my registration page. If you have any solutions are need more information. Please let me know Many thanx Garth -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] calling javascript
I want to call a javascript function: function error_popup() { newwin = window.open(error_popup.php,sss,height=470,width=450) } from within my php code. How do I go about called this function? Garth
Re: [PHP] calling javascript
by saying ? echo error_popup(); or print error_popup; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] calling javascript
You can't call JavaScript functions from within PHP. You can output the JavaScript function to the browser. PHP == Server Side JavaScript == Client Side Ok so what does this mean I should write..I don't understand what you mean by Server Side/Client Side. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] calling javascript
Thanx for your help, I am actually a web designer! I dont think u understand 100% I have a form and Im doing a check on submission to check whether there are any blank field and if there are I want to call function.. error_popup(); does this make anymore sense to you. Now I understand that you cant call javascript from within php. wot would you recommend as an alternative. I dont have a button or anything that I want to press, just want to call the function so it can open a popup window. Regards Garth Ben Ramsey [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Garth Hapgood - Strickland wrote: by saying ? echo error_popup(); or print error_popup; As someone mentioned, you cannot call a javascript function from within PHP. What is meant by client side/server side is this: PHP is processed on the server before sending any content to the browser; that's server-side. Then, the server sends the HTML output of the PHP script to the browser. Any javascript you have in the output is enacted in the browser (client-side). So, you want your PHP to output the javascript just like it might output HTML: i.e. echo 'script type=text/javascript'; echo 'function error_popup() { newwin = window.open(error_popup.php,sss,height=470,width=450) }'; echo '/script'; echo 'input type=button onclick=error_popup()'; Sounds to me like you need to go back and revisit the introductory pages of the PHP manual. Take a look at http://www.php.net/introduction and follow the subsequent pages to read more about PHP and what it can do. It'll also take you through a tutorial that's fairly helpful. -- Regards, Ben Ramsey http://benramsey.com --- Atlanta PHP - http://www.atlphp.org/ The Southeast's premier PHP community. --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] trying 2 pull data out table and populate a list box
Thanx so much Reinhart It works fine now. Ok so i have my list populated now. IF I want to diplay select one at the top of the list box, not as an option, but just so that the user knows to select an item. How will I put that in the code? Greets Garth -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] trying 2 pull data out table and populate a list box
I am trying to pull all data out of a table called province which has 2 fields ProvinceID and Description respectively. Now I want to populate a list with all the data in the descriptions field. Many thanx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php