
cyandi_man
Members-
Posts
16 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
cyandi_man's Achievements

Newbie (1/5)
0
Reputation
-
How do i implement google Maps into My loop?
cyandi_man replied to cyandi_man's topic in PHP Coding Help
Gad Zooks! thats it! thanks man! i will try that right away! -
Hi guys - I have a comapany listing page which the user can do a search for companies by city in the gta, ontario canada. The thing is how do i imlement the following code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/ <title>Google Maps JavaScript API Example</title> <script src="http://maps.google.com/maps? mykey goes here &sensor=true" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ function load() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); map.setCenter(new GLatLng(43.5658865,-79.7006233), 15); // (up/ down- lower=down, left/right-lower is left), larger for zoom) >-79.5921458,43.5494699 var marker = new GMarker(new GLatLng(43.5658865,-79.7006233)); map.addOverlay(marker); } } //]]> </script> </head> <body onload="load()" onunload="GUnload()"> <div id="map" style="width:400px;height:250px"></div> </body> </html> INTO my page that dynamically pulls all the locations from a database? i actually entered this code into the database field called "Map" changing only the co-ordinates for each location -- however only the first business lisiting has the map pop up. I know it has to be because this code is starting and terminating with head, body and html tags. what is the correct way of doing this? (i am new to coding - forgive me!)
-
trying to have a function within a loop ..help please!
cyandi_man replied to cyandi_man's topic in PHP Coding Help
EXCELLENT BOSS! i thought so... it works! thanks a million! -
Where can I stick my function that formats my phone number string from my database before it is displayed on the page? I am trying to add the following function: function format_tel_num($contactNumber){ //<-- contactNumber is a field on database. return preg_replace('/\d{3}/', '$0.', str_replace('.', null, trim($contactNumber)), 2); } $contactNumber = format_tel_num($contactNumber); Into the following php file below - containing the following code without breaking my loop? do i need to make this function a global function outside of the loop? --query that gathers info from database-- $result= mysql_query($query) $nrows=mysql_num_rows($result); if ($nrows == 0) { echo "There are no clinics listed with that criteria at this time. Please choose again."; } else{ while ($row = mysql_fetch_array($result)) { extract($row); if($logos!="../logos/profs/spacer.gif"){ echo " code that displays data from database"; } else { echo " coding that dislpays slightly different data from database"; } } } Thank you guys - you all have been great in answering my questions so far!
-
your awsome dude! thanks! - question is though ...how do i INSERT the brackets and dashes when displaying the phone number? i suppose i would have a function that puts a "(" in front of the string and then counts 3 digits and puts a ")" and then counts 3 digits and then put a "-". but whats the proper format for the code?
-
Hi guys - i have a mini search page on my site in which i want people to be able to pull contact info by either typing in a Phone number or Company name in the search fields. Question is: 1. how do i have php compare the Phone number entered and phone number on database by just verifying that they have the same numbers in the same sequence? (ignoring any brackets or dashes) 2. how do i have the Company Name field search the database for any word that was entered in the input field excluding "the" Please advise ...thanks fellas!
-
Switch statement seems to work ...somewhat :S
cyandi_man replied to cyandi_man's topic in PHP Coding Help
Thanks - i corrected that . however it seems that i am not getting the values for industry and city from my form page when i choose "-any city-" and/or "-any discipline-" Im new to coding...so - im not sure if i coded my drop down menu correctly. i coded it as follows. <?php -database connection code- $connection = mysql_connect($host,$user,$password) or die ("couldn't connect to server"); $db = mysql_select_db($database,$connection) or die ("Couldn't select database"); $query = "SELECT DISTINCT industry FROM Proffesional_list ORDER BY industry"; $result = mysql_query($query) or die ("Couldn't execute query."); $query2 = "SELECT DISTINCT city FROM Proffesional_list ORDER BY city"; $result2 = mysql_query($query2) or die ("Couldn't execute query."); $anycity ="-Any City-"; $anyplace ="-Any Discipline-"; /* create form containing selection list */ echo "<form action='code/memberdisplaylist.php' name='list1_form' method='POST'> <select name='industry'>\n"; echo "<option value='$industry'>$anyplace</option>\n"; while ($row = mysql_fetch_array($result)) { extract($row); echo "<option value='$industry'>$industry\n"; } echo "</select>\n"; ?> //location dropdown menu <p> </p> <span class="subheading">Location</span> <br/><?php /* create form containing selection list */ echo "<form action='code/memberdisplaylist.php' name='list1_form' method='POST'> <select name='city'>\n"; echo "<option value='$city'>$anycity</option>\n"; while ($row2 = mysql_fetch_array($result2)) { extract($row2); echo "<option value='$city'>$city\n"; } echo "</select>\n"; ?> <p> </p> <?php ?> Is there anything wrong with my php coding? (edited to add tags) -
Hi fellas...i took some advice in using a switch statement to accomplish what i wanted. I basically just want a specific list to be displayed depending on the office type and location chosen from a dropdown list. Only now the listing that is displayed does not seem to co-inside with the selected choices from the drop-down. ex. if choosing a chiropractor from toronto, i get an optometrist showing up in the list! I checked the switch code and it seems to be correct!? help please! thanks for the help! only now it seems that there is something wrong with my switch statement! --database statements-- $db = mysql_select_db($database,$connection) or die ("Couldn't select database"); if ($city=="-Any City-" && $industry=="-Any Discipline-") { $i==0; } elseif ($city!="-Any City-" && $industry!="-Any Discipline-") { $i==1; } elseif ($city=="-Any City-" && $industry!="-Any Discipline-") { $i==2; } elseif($industry=="-Any Discipline-" && $city !="-Any City-") { $i==3; } switch ($i) { case 0: $query = "SELECT * FROM Proffesional_list"; break; case 1: $query = "SELECT * FROM Proffesional_list WHERE industry='$industry' AND city='$city'"; break; case 2: $query = "SELECT * FROM Proffesional_list WHERE industry='$industry'"; break; case 3: $query = "SELECT * FROM Proffesional_list WHERE city='$city'"; break; } $result= mysql_query($query) or DIE("unable to retrieve database info"); --echo statements pas here-- I do get listings that show up - but not the proper selections!
-
Hi Guys - id like to thank you all for helping me thus far. I was wondering if anybody can tell me if there is anything wrong with the following loop. What it is is a directory listing that you can choose the location and service from dropdown menus. then the next page will display a list of locations based on your pick. im not sure.. but it seems like the default selections (it is a dropdown menu) are not returning a value. Please help! --previous code-- $db = mysql_select_db($database,$connection) or die ("Couldn't select database"); if ($industry=="-Any Dicipline-" && $city !="-Any City-"){ $query = "SELECT * FROM Proffesional_list WHERE city='$city'"; } else if ($city=="-Any City-" && $industry!="-Any Dicipline-"){ $query = "SELECT * FROM Proffesional_list WHERE industry='$industry'"; } else if ($city=="-Any City-" && $industry=="-Any Dicipline-"){ $query = "SELECT * FROM Proffesional_list"; } else if ($city!="-Any City-" && $industry!="-Any Dicipline-"){ $query = "SELECT * FROM Proffesional_list WHERE industry='$industry' AND city='$city'"; } $result= mysql_query($query) or DIE("unable to retrieve database info"); rest of the code and echo statements... As you can see, my data is on the Proffesional_list (I KNOW I SPELLED IT WRONG) only when i choose an actual item and location - the list is displayed - but when i choose one or the other or none at all - i get a blank listing. The page with the dropdown menu precedes the page with the above code... The dropdown menu in question is coded in php like so: $query2 = "SELECT DISTINCT city FROM Proffesional_list ORDER BY city"; $result2 = mysql_query($query2) or die ("Couldn't execute query."); /* create form containing selection list */ echo "<form action='code/memberdisplaylist.php' name='list1_form'> <select name='industry'>\n"; echo "<option value='$industry'>-Any Dicipline-\n";//<--this should be the default value while ($row = mysql_fetch_array($result)) { extract($row); echo "<option value='$industry'>$industry\n"; } echo "</select>\n"; ?> Is the default &industry value coded correctly? The items in the industry dropdown are pulled dynamically from the database - except for the default value. Please help! Thanks in advance!
-
OOPS! how silly of me! the problem is: the code does not add the new entry to the appropriate tables. the message in the print command does not appear.
-
the following is in the PHP file: while ($row = mysql_fetch_array($result)) { extract($row); echo "<div width='98%'> <table width='420px' style='float:left' class='topprofiletable'> <tr><td><b><font color='666666'>Family Member:</font></b> </td><td>$clientNumber </td></tr> <tr><td><b><font color='0000ff'>$firstName, $Minitial $lastName</font></b></td><td> <b>Gender:</b>$gender</td></tr> <tr><td style='float:left' class='item'>Street Address:</td><td style='float:right'><input type='text' name='streetad' value=$streetAddress></td></tr> <tr><td style='float:left' class='item'>City:</td><td style='float:right'><input type='text' name='city' value=$city></td></tr> <tr><td style='float:left' class='item'>Province:</td><td style='float:right'><input type='text' name='prov' value=$province></td></tr> <tr><td style='float:left' class='item'>Postal Code:</td><td style='float:right'><input type='text' name='postal' value=$postal></td></tr> <tr><td style='float:left' class='item'>Phone Number:</td><td style='float:right'><input type='text' name='phone' value=$Hphone></td></tr> <tr><td style='float:left' class='item'>Cell Number:</td><td style='float:right'><input type='text' name='cell' value=$Cphone></td></tr> <tr><td style='float:left' class='item'>Office Number:</td><td style='float:right'><input type='text' name='work' value=$Wphone></td></tr> <tr><td style='float:left' class='item'>Fax:</td><td style='float:right'><input type='text' name='fax' value=$Fax></td></tr> <tr><td style='float:left' class='item'>Email:</td><td style='float:right'><input type='text' name='email' value=$email></td></tr> </table> </div>"; }
-
hi gang just wondering if you would be able to help me with this php code here. the data '$amount' and '$pnts' comes from a flash file which has been verified to not contain the error. what this php code is trying to do is check total points on a table in sql and comparing with the points that the user wishes to redeem. If the total points on mySQL is sufficient enough - the points are redeemed and the redeemed points go into a 'total points redeemed' table. if not then the appropriate error message is sent to the swf. session_start(); $clientN = $_SESSION['client']; $me = $_SESSION['name']; $me2 = $_SESSION['name2']; if (@$_SESSION['auth']!="yes") { header("Location: ../personal_account_login.php"); exit(); }$user="Myuser"; $host="localhost"; $password="MYpass"; $database = "myDatabase"; $connection = mysql_connect($host,$user,$password) or die ("couldn't connect to server"); $db = mysql_select_db($database,$connection) or die ("Couldn't select database"); $db = mysql_select_db($database,$connection) or die ("Couldn't select database"); $query1 = "SELECT totalpnts FROM patient_totals WHERE clientNumber='$clientN'"; $result1 = mysql_query($query1) or die(mysql_error()); while($row1 = mysql_fetch_array($result1)){ extract($row1); if ($pnts > $totalpnts) { Print "_root.status=SORRY! You Do Not Have Enough Health Points to Redeem This Item - Please Choose Again!"; } else { $newtotal= $totalpnts - $pnts; $queryx = "UPDATE patient_totals SET totalpnts='$newtotal' WHERE clientNumber='$clientN'"; $resultx = mysql_query($queryx) or die(mysql_error()); $query3 = "INSERT INTO redemption(clientNumber, firstName, lastName, product, amount, pnts) VALUES('$clientN', '$me', '$me2', '$item','$amount', '$pnts')"; $result3= mysql_query($query3) or DIE("Unable to redeem your points at this time...please try again later."); Print "_root.status=You have successfully redeemed $pnts Points! You will receive an email with your voucher attached within 24hrs. Thank you!"; } } any help would be greatly appreciated - THANKS!
-
Hi guys, i have a php form that pulls data from mySql database. for some reason this info is being truncated. ex. in the zipcode field only first 3 numbers show up and only the first part of the street address shows up. I do have that particular cell as VARCHAR on the database so that i can have both numbers and letters as data. do spaces in the data have anything to do with it? or should this be more of a question for a mySql forum? **also the text field on my php form is a large enough size to hold the data - so i doubt that is the issue anyway - it pulls in all the data even if it was not long enough wouldnt it? please advise - thanks!
-
thanks ..im totally new to coding ...php especially. this is done on the server right? if i have my site up with a hosting company - shouldnt this be already on? or not necessarily? I also have not set up a testing server on my cpu.
-
I have a password change page that uses a php file that updates password on an mySQL database. however when submit is hit i see the current page go blank and it does not redirect to the "password success" page. The password HAS indeed been updated - however there seems to be an issue with my header function that sends the user to the notification page. I have other sections in this website that use the EXACT same coding and it works without flaw!....eg. other member password update pages. I am using IE - what on earth is going on?? <? $user="Proadmin"; $host="localhost"; $password="mypassword"; $database = "mydatabase"; $connection = mysql_connect($host,$user,$password) or die ("couldn't connect to server"); $db = mysql_select_db($database,$connection) or die ("Couldn't select database"); $db = mysql_select_db($database,$connection) or die ("Couldn't select database"); $clientN= $_POST['clnt']; $user = $_POST['puser2']; $password = $_POST['ppassword2']; $query = "UPDATE vendors SET pass = '$password', user = '$user' WHERE vendor_number='$clientN'"; if(mysql_query($query)){ header("Location: http://provicanhealth.com/vendor_pass_successEX.php"); exit; } else{ header("Location: http://provicanhealth.com/vendor_passchange_errorEX.php"); exit; } ?>