
Gmunky
Members-
Posts
56 -
Joined
-
Last visited
Never
Everything posted by Gmunky
-
[SOLVED] Please Help A Newbie... Simple Question With Mysql Where
Gmunky replied to Looktrne's topic in PHP Coding Help
if $mi is a number, then you won't need the single quotes around the $mi in the query -
$number= 111111111111; $newnumber= "********" . substr($number,12,4);
-
number_format($number);
-
have you tried adding this line 'session_cache_limiter('private');' before session_start()?
-
try if($_POST["full_name"] != null) echo "Full Name:<br> ". $_POST["full_name"]. "<br>"; if($_POST["primary_phone"] != null) echo "Primary Phone:<br> ". $_POST["primary_phone"]. "<br>"; Do this for all the posts. I hope this helps
-
if($secondphone != null) echo "Secondary Phone: $secondphone";
-
Thank you for the help! this works: $cust = array_slice($cust, 0, count($cust), false);
-
I need the array numbers to basically just reset back to [0].
-
well I retrieve a number of records from a database and I save those ID's in an array. //Run query to retrieve all customers of the division////////////////// $query ="SELECT CUST FROM HYLIB.ARD WHERE DIVI=".$divi." ORDER BY NAME ASC"; $rs=odbc_exec($conn,$query); if(!$rs) { $errors["query"] = "ARD order# query failed"; $_SESSION["errors"]=$errors; write_to_log($errors,"stopped"); header('Location: menu.php'); exit; } //////////////////////////////////////////////////////////////////////// /////Save customer IDs in an array////////// $i=0; while (odbc_fetch_row($rs )) { $cust[$i] = odbc_result($rs,"CUST"); $i++; } $cust=array_unique($cust); print_r($cust); This is how I get : Array ( * => 10078 [9] => 10293 [10] => 10088 [11] => 10237 [12] => 10211 [13] => 10282 [14] => 10300 [15] => 10110 [16] => 10077 [19] => 10063 [21] => 10296 [22] => 10280 [23] => 10082 [27] => 10079 [29] => 10080 [30] => 10301 [31] => 10291 [32] => 10290 [33] => 10294 [34] => 10111 )
-
I have an array : Array ( [0] => 10078 [9] => 10293 [10] => 10088 [11] => 10237 [12] => 10211 [13] => 10282 [14] => 10300 [15] => 10110 [16] => 10077 [19] => 10063 [21] => 10296 [22] => 10280 [23] => 10082 [27] => 10079 [29] => 10080 [30] => 10301 [31] => 10291 [32] => 10290 [33] => 10294 [34] => 10111 ) i want to be able to keep the same order of the values but i need the index to NOT skip! notice the first array is [0] and then the next one is [9]. how can change this so the array numbers are [0],[1],[2],etc.? thank you for the help!
-
I have two buttons on a page ,one is a print screen button and another a search button. The problem is when I press the enter key in the keyboard, the print button is triggered. What's a way so when I press enter, the search button will be activated instead of the print button?
-
If I have a string $string = "SELECT * FROM TABLE WHERE AGE > 0 ORDER BY NAME"; how would I retrieve part of the string before 'ORDER'; i want this part 'SELECT * FROM TABLE WHERE AGE > 0' if i use strstr($string,"ORDER"), this retrieves 'ORDER BY NAME' is there an opposite function of strstr()?
-
Hello. I have a drop down list : <select> <option>Apple</option> <option>Orange</option> <option>Banana</option> </select> The problem is once an item is selected and the submit button is pressed, the dropdown refreshes and goes back to the first option which is 'Apple' in this case. I want the value picked to stay selected after the submit button is pressed. Thanks for the help!
-
My error went away but I still don't get an email. I'm on an AS400/IBM platform Is there something I need to change in the .ini file? this is what mine looks like right now [mail function] SMTP = localhost smtp_port = 25 sendmail_from = [email protected] ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). sendmail_path = ; Force the addition of the specified parameters to be passed as extra parameter ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters =
-
I just tried it and it still doesn't work. I dont think that part of the code is the problem. Even if i hardcode the values and use mail("[email protected]","hello","This is a test"); i still get this error: ErrorCode: 2 ErrorMsg : mail() [function.mail]: Unable to send message to SMTP server. No recipients specified. ite. ice ready. mail not sent
-
thanks, but it didn't work. I still get the same error.
-
I have a form page that has a subject,message, and from text box. I want to be able to send email once the submit button is clicked. my code: //if submit button is clicked, send email if (isset($_POST['submit'])) { $from=$_POST['from']; $message=$_POST['message']; $subject=$_POST['subject']; //$to=$_POST['to']; $to="[email protected]"; $date = date("F j, Y, g:i a"); $headers ="From: [email protected]"; if ( mail("$to","$subject","$message") ) { echo "<font color=red>Your message has been sent to $to. Thank You!</font><br>"; } else echo "mail not sent"; } The problem is I Keep getting this error below and I have no clue how to fix it! ErrorCode: 2 ErrorMsg : mail() [function.mail]: Unable to send message to SMTP server. No recipients specified. ite. ice ready. mail not sent
-
There is a list from a database I want to be able to print out and sort them by last name within first name but also if there isn't a name, I want to print out the company name in alphabetical order first and then the names. fname | lname | company name| ------------------------------- james| blunt | | John | blunt| bryan | wilson| | | |focus co. | | | gap | I want to be able to print out in this sort of order: focus co. gap blunt, james blunt, john wilson,bryan My query is 'Select * from table order by lname,fname asc'] The problem with this is that the company names are not in order.
-
no. I'm actually using 'FROM: [email protected]' for the header. And I have the domain set up like your reply. I'll have to ask someone who set up the server about the security settings. Thnks
-
I am trying to send a simple email using the mail() function. But I get a weird error: ErrorCode: 2 ErrorMsg : mail() [function.mail]: Unable to send message to SMTP server. No recipients specified. ite. ice ready. mail not sent my code: mail("[email protected]","test subject","test message","FROM: [email protected]") I'm thinking I might have to change my php.ini file? or my server isn't set up right? any help would be appreciated.Thanks!!
-
Need help with extracting part of a text in a text file
Gmunky replied to Gmunky's topic in PHP Coding Help
when I try your method: $file=fopen("file.txt","r")or exit("Unable to open file!"); while (!feof($file)) { $string .= fgets($file); } fclose($file); $pos1 = strpos($string, "<ECHOTYPE3>"); $pos2 = strpos($string, "</ECHOTYPE3>"); $xmlstring=substr($string, $pos1, $pos2); echo $xmlstring; with this code, I still get extra characters that I don't want: here's my output: <ECHOTYPE3><status>G</status><id>erere</id><auth>3</auth></ECHOTYPE3> --> </BODY></HTML> i dont want this to show up in the output: --></BODY></HTML> -
I am having trouble trying to save part of the text file to a string variable. my text file looks something like this: <HTML><HEAD><title>ECHOnline Response</title></HEAD><BODY> <!-- <ECHOTYPE1><status>G</status><id>erere</id><ECHOTYPE1> --> <ECHOTYPE2><table><tr><td>g</td><td>erere</td></tr></table><ECHOTYPE2> <!-- <ECHOTYPE3><status>G</status><id>erere</id><auth>3</auth></ECHOTYPE3> --> </BODY></HTML> what I want to do is to be able to just save this part of the file in a string variable: <ECHOTYPE3><status>G</status><id>erere</id><auth>3</auth></ECHOTYPE3> thank you for all your help!
-
hello. I was wondering if anyone knows a good way to write a query when you have a list of primary keys. for intance, if I have a table 'User' with id (primary key) ,fname and lname for the attributes, and I want to print out the fname and lname of all the users that matches my array of ids. id[array] = (1,2,3,4,5,7,etc.) // i want to print out the names that have these ids USER -------- id | fname | lname ------------------ 1 bob barker 2 jo blo 3 james blunt 4 .. .. 5 .. .. 6 .. .. 7 .. .. thank you for all your help!
-
I need help with I think should be a pretty simple query.
Gmunky replied to Gmunky's topic in MySQL Help
ok. how about if I want to output the studentID's that are NOT null?