Jump to content

croakingtoad

Members
  • Posts

    65
  • Joined

  • Last visited

    Never

Everything posted by croakingtoad

  1. Tried that...didn't work...? Something else must be wrong?
  2. I have a page that submits to itself and I'm trying to detect the submit post but it's not working. I'm not sure what's going on here...can someone help? Here's the code-- <? if ($_POST['Submit']) { $thanks = "Thank you for your inquiry. We will be in touch. If you have any questions in the interim, please feel free to contact us."; } //HTML head removed <body> <? echo $thanks; ?> <form action="bedside-manner.php" name="form1"> //form contents <input type="submit" value="Submit" name="Submit" /> </form> </body> </html> You can view this in action here-- http://www.ourhealthswva.com/bedside-manner.php Thanks in advance.
  3. Here is what I have come up with that is very close to working, I'm just having one problem- $row = mysql_num_rows($query); for ($i = 0; $i< $row; $i++) { $record = mysql_fetch_row($query); if ($record[0] !== "12" && $record[0] !== "20" && $record[0] !== "10") { if (is_int($i / 4)) { echo "<div class=\"container\" id=\"$i\">"; } echo "<div class=\"associate\"> <img src=\"\" width=\"147\" height=\"220\" /></div> "; //echo "$row $record[1]" . " " . "$record[2]" . "<br />"; } if (is_int($i / 4)) { echo "</div>"; } } In short what this should be doing is determining if the value of $i divided by 4 is an integer. If it is, then it should echo out my container div with it's closing tag. This seems to be working okay except that when it calculates iteration '4' it is returning false. The answer is 1 with no decimals so I'm not sure why it's failing that count. Here is the subsequent output I am getting- <div class="container" id="0"> <div class="associate"> <img src="" width="147" height="220" /></div> </div> (WHY IS THIS DIV HERE?) <div class="associate"> <img src="" width="147" height="220" /></div> <div class="associate"> <img src="" width="147" height="220" /></div> <div class="associate"> <img src="" width="147" height="220" /></div> </div> <div class="associate"> <img src="" width="147" height="220" /></div> <div class="associate"> <img src="" width="147" height="220" /></div> <div class="container" id="8"> <div class="associate"> <img src="" width="147" height="220" /></div> </div> (WHY IS THIS HERE?) <div class="associate"> <img src="" width="147" height="220" /></div> <div class="associate"> <img src="" width="147" height="220" /></div> <div class="associate"> <img src="" width="147" height="220" /></div> <div class="container" id="12"> <div class="associate"> <img src="" width="147" height="220" /></div> </div> (WHY IS THIS HERE?) <div class="associate"> ETC ETC... I have put in the container divs an id that is the value of $i. Thanks!
  4. That was kind of the part I was wanting help with
  5. Hello, I have written a basic loop- $row = mysql_num_rows($query); for ($i = 0; $i< $row; $i++) { $record = mysql_fetch_row($query); if ($record[0] !== "12" && $record[0] !== "20" && $record[0] !== "10") { echo "$record[1]" . " " . "$record[2]" . "<br />"; } } What I think I need is a loop within a loop because what I want to end up with is something like-- <div class="container"> <div class="associate"> <img src="**" width="147" height="220" /><br />div 1</div> <div class="associate"> <img src="**" width="147" height="220" /><br />div 2</div> <div class="associate"> <img src="**" width="147" height="220" /><br />div 3</div> <div class="associate"> <img src="**" width="147" height="220" /><br />div 4</div> </div> <div class="container"> <div class="associate"> <img src="**" width="147" height="220" /><br />div 1</div> <div class="associate"> <img src="**" width="147" height="220" /><br />div 2</div> <div class="associate"> <img src="**" width="147" height="220" /><br />div 3</div> <div class="associate"> <img src="**" width="147" height="220" /><br />div 4</div> </div> The details being pulled in from the database are marked with an asterisk above. I need the container div to only be echoed once every 4 iterations. Does that make sense? How would I take what I have and get that? Thanks!!
  6. I am trying to write a cron job to automate a task I can never remember to do. I need it to execute the following commands with variables.  I started dabbling with it in PHP ... can someone help me fill in the gaps? [code] $month = date("M");  // I actually need this to be the previous month, so whatever the current month go back to the previous month $year = date("Y"); $grep = shell_exec("grep -i '$month/$year' /usr/local/apache/domlogs/logfile > /home/roanoke/logs/logfile-$month-$year"); *pause*  // this is a big file and will need 10-15 minutes to process the grep command $gzip = shell_exec("gzip '/home/roanoke/logs/logfile-$year-$month'"); *pause*  // gzip will probably take 2-3 minutes $drop = ""; // I need to strip any line from the file /usr/local/apache/domlogs/logfile containing "$month/$year".  Or could I use the already existing var $grep somehow from above to do that? [/code] All help is much appreciated!
  7. okay...so when I add the id back in (copy your line above) it just reloads the page again...back to the same problem... ARGH!
  8. Hi Ray,  The id is from the content management system I'm using.  It identifies the page to load.  This page is page 6 in the database and loads it into a template. When i use your example it takes me to the root index page.  Is there a way to append ?id=6 to what you have?  Would that work?
  9. I'm still having the same issue...here's what I have now.  When I submit the form the if() isn't getting picked up... [code] if (isset($_POST['submit'])) { extract($_POST); $subject = "Contact from Firefly website"; $headers = "From: $firstName $lastName <$email>"; $to = $to . "@fireflylightinginnovations.com"; $message = "Email from:" . "\r\n"; $message .= "$firstName $lastName" . "\r\n"; $message .= "$title" . "\r\n"; $message .= "$company" . "\r\n"; $message .= "$phone" . "\r\n"; $message .= "$email" . "\r\n" . "\r\n"; $message .= "Message:" . "\r\n"; $message .= "$mess"; /* mail($to, $subject, $message, $headers); */ echo "$to<br />$headers<br /><br />$message"; echo '<h3>Thank you!</h3> <p>Your message has been sent.  Someone will contact you within 2 business days.</p>'; } else { echo "<form action=\"index.php?id=6\" method=\"post\">"; echo ' <label>Send message to:</label> <select name="to"> <option value="">Select a Recipient</option> <option value="sales">Sales</option> <option value="engineering">Engineering</option> <option value="marketing">Marketing</option> <option value="service">Customer Service</option> </select><br /> <br /> <input type="text" name="firstName" size="20" /> <label>First Name</label><br /> <input type="text" name="lastName" size="20" /> <label>Last Name</label><br /> <br /> <input type="text" name="title" size="20" /> <label>Title</label><br /> <input type="text" name="company" size="20" /> <label>Company Name</label><br /> <input type="text" name="phone" size="20" /> <label>Phone Number</label><br /> <input type="text" name="email" size="20" /> <label>Email Address</label><br /> <br /> <textarea name="mess" rows="10" cols="20">Please use this area to type your message.</textarea> <input type="submit" value="Send Message" name="submit" /> </form>'; } [/code] I just added a line into the else section that displays the form to echo out a couple of the $vars and nothing is showing up there either after submit....any ideas what I'm doing wrong?
  10. [quote author=spfoonnewb link=topic=118340.msg483489#msg483489 date=1165949967] Put [code]$email = $_POST['email'];[/code] Above that code. (Like right under the <?php) [/quote] What I mean is a way to take every $_POST[] var and change it to just a standard php var like $var instead of $_POST['var'].  But do it to all of them at once without having to manually set every one..?
  11. Thanks!! Just out of curiosity is there a way to have the variables converted from $_POST['email] to just $email with one generic line or two of code? 
  12. I have the following code and am trying to get the form to submit to itself but when you submit the form, it reloads the page but doesn't execute the first if() statement...not sure what I'm doing wrong.  It just reloads the page... Any help appreciated! [code] if (isset($email)) { $subject = "Contact from Firefly website"; $headers = "From: $firstName $lastName <$email>"; $to = $to . "@fireflylighting.com"; $message = "Email from:" . "\r\n"; $message .= "$firstName $lastName" . "\r\n"; $message .= "$title" . "\r\n"; $message .= "$company" . "\r\n"; $message .= "$phone" . "\r\n"; $message .= "$email" . "\r\n" . "\r\n"; $message .= "Message:" . "\r\n"; $message .= "$mess"; /* mail($to, $subject, $message, $headers); */ echo "$to<br />$headers<br /><br />$message"; echo '<h3>Thank you!</h3> <p>Your message has been sent.  Someone will contact you within 2 business days.</p>'; } else { echo "<form action="index.php?id=6" method=\"post\">"; echo ' <label>Send message to:</label> <select name="to"> <option value="">Select a Recipient</option> <option value="sales">Sales</option> <option value="engineering">Engineering</option> <option value="marketing">Marketing</option> <option value="service">Customer Service</option> </select><br /> <br /> <input type="text" name="firstName" size="20" /> <label>First Name</label><br /> <input type="text" name="lastName" size="20" /> <label>Last Name</label><br /> <br /> <input type="text" name="title" size="20" /> <label>Title</label><br /> <input type="text" name="company" size="20" /> <label>Company Name</label><br /> <input type="text" name="phone" size="20" /> <label>Phone Number</label><br /> <input type="text" name="email" size="20" /> <label>Email Address</label><br /> <br /> <textarea name="mess" rows="10" cols="20">Please use this area to type your message.</textarea> <input type="submit" value="Send Message" name="submit" /> </form>'; } [/code]
  13. Hello, At a former web development company we used a visual development tool to produce placeholder pages with active navigation to help our customers visualize how their website would fit together as well as planning it ourselves.  I can't remember the name of the program though.  Anyone know of any good tools that'll do that sort of thing? Cheers! CT
  14. I'm trying my hand at modrewrite but have run into an issue. Here's what I have in my htaccess- [code] Options +FollowSymLinks RewriteEngine on RewriteRule (.*)/real-estate/(.*)/(.*)/ details.php?data=$3&MLS=$2&mun=$1 RewriteRule (.*)/real-estate/(.*)/(.*) details.php?data=$3&MLS=$2&mun=$1 [/code] When I type in a url like below- [a href=\"http://www.foo.com/botetourt/real-estate/345123/1/\" target=\"_blank\"]http://www.foo.com/botetourt/real-estate/345123/1/[/a] which translates to- [a href=\"http://www.foo.com/details.php?data=1&MLS=345123&mun=botetourt\" target=\"_blank\"]http://www.foo.com/details.php?data=1&MLS=...3&mun=botetourt[/a] What's happening though is I get a SQL error because it's passing the value of $MLS as '345123/1' instead of '345123' and separating the '1' as the value of $data. What am I doing wrong here? Thanks!
  15. That didn't give much more info-- Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE mls = '701555'' at line 1 with query What's strange is when I type the query into SQLyog-- SELECT * FROM flex_residential WHERE mls = 701555 it returns the correct result... I'm such an idiot, nevermind. I wasn't passing a required variable to the url to satisfy a switch I had right above this code that gives the value of $table. Sorry for my Friday dumbness!
  16. Okay, should i replace part of my code with that or append it somewhere? Thanks!
  17. Okay, maybe not... I changed it in the DB from varchar to int and empties the DB then ran the script to put data back into it and I am still getting that error. Any other ideas?
  18. Brilliant, I'm working again. I think I had deleted my outer/inner loop at some point because I was getting duplicate stuff, but nevermind, seems good now. So on to the next question... The array now looks like this-- [code] [137] => Array                 (                     [0] => Lot Description|Other - See Remarks|Yes                     [1] => Lot Description|Views|Yes                     [2] => Construction|Brick|Yes                     [3] => Construction|Other - See Remarks|Yes                     [4] => Miscellaneous Info|Single Wide|No                     [5] => Miscellaneous Info|Double Wide|No                     [6] => Heating|Heat Pump Electric|Yes                     [7] => Cooling|Heat Pump Electric|Yes                     [8] => Interior Features|Storage|Yes                     [9] => Interior Features|Walk-in-Closet|Yes                     [10] => Exterior Features|Deck|Yes                     [11] => Exterior Features|Storage Shed|Yes                     [12] => Appliances|Dishwasher|Yes                     [13] => Appliances|Clothes Dryer|Yes                     [14] => Appliances|Microwave Oven|Yes                     [15] => Appliances|Oven|Yes                     [16] => Appliances|Refrigerator|Yes                     [17] => Appliances|Range|Yes                     [18] => Appliances|Clothes Washer|Yes                     [19] => Misc Features|New Construction|Yes                     [20] => Floors|Carpet|Yes                     [21] => Floors|Concrete|Yes                     [22] => Windows|Tilt-In|Yes                     [23] => Exterior Doors|Wood|Yes                     [24] => Porch|Rear Porch|Yes                     [25] => Water Description|Public Water|Yes                     [26] => Sewer Description|Public Sewer|Yes                     [27] => Bedrooms|Bedrooms Entry Level|1                     [28] => Bedrooms|Bedrooms Upper Level|0                     [29] => Bedrooms|Bedrooms Lower Level|0                     [30] => Bedrooms|Bedrooms Other Level|0                     [31] => Full Baths|Full Baths Entry Lvl|1                     [32] => Full Baths|Full Baths Upper Lvl|0                     [33] => Full Baths|Full Baths Lower Lvl|0                     [34] => Full Baths|Full Baths Other Lvl|0                     [35] => Half Baths|Half Baths Entry Lvl|0                     [36] => Half Baths|Half Baths Upper Lvl|0                     [37] => Half Baths|Half Baths Lower Lvl|0                     [38] => Half Baths|Half Baths Other Lvl|0                     [39] =>                 ) [/code] So the question is, as you can see from the array there are numerous entries for "Appliances". What if I wanted to parse through there and pull them all out into a csv list? Result that I'm looking for example- [code] $appliances = "appliance1, appliance2, appliance3, appliance4"; [/code] The thing to understand here, is it could always be different and what I want to grab is in between the pipes. The actual names, not "Appliances" and not "Yes". thanks!
  19. that's what it was, i had it as varchar
  20. I changed mine to match your suggestion but I still get the error-- [code] $query = mysql_query("SELECT * FROM $table WHERE mls = '$MLS'") or die(mysql_error()); [/code] [code] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE mls = '701555'' at line 1 [/code]
  21. here's what I have- [code] $query = mysql_query("SELECT * FROM $table WHERE mls = $MLS") or die(mysql_error()); [/code] I'm getting the error- [code] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE mls = 701555' at line 1 [/code] What am I doing wrong?
  22. I'm trying to explode() this multidimensional array, in fact it was working at some point in the past but I've recently made some changes and it's stopped working. So here's what I've got... $_arr = primary array below [code] [3364] => Array                 (                     [0] => 20051230194116769413000000                     [1] => 20060413190808359724000000                     [2] => 00                     [3] => 701429                     ....                     [137] => Construction|Vinyl|Yes;Heating|Baseboard Electric|Yes;Heating|Forced Air Gas|Yes;Cooling|Window A/C|Yes;Water Description|Public Water|Yes;Sewer Description|Public Sewer|Yes;Lease Type|Month-to-Month|Yes;Owner Expenses|Water|Yes;Tenant Expenses|Electricity|Yes;Tenant Expenses|Gas|Yes;                 ) [/code] Okay, so here's the code I have, basically I want to brake apart any part of the primary array that has a pipe '|' in it into a new sub-array of the primary array... [code] foreach($_arr as $key => $row) {     if($key != 0) {         if (strpos($row, '|') !== false) {             $_arr2[$i][$key] = explode(';', $row);         } else {             $_arr2[$i][$key] = $row;         }     } } echo '<pre>', print_r($_arr2, true), '</pre>'; [/code] Why isn't this working? All I get is what's in the first [ code ] block...
  23. Does anyone have any experience setting up TYPO3 with dbal (using adodb) for MSSQL? I have been beating my head against the wall and would like to get some installation help if possible. Basically I've installed the base package and dummy site and have tried to get dbal and adodb extensions to work but the installer won't work and when I try to manually setup the site I'm just getting errors. Has anyone else out there done this successfully? Thanks! Marty M.
  24. Does anyone know of a good quality CMS that has native MSSQL support? I was looking at modX CMS but it doesn't yet support MS...
  25. I am working for a company who uses MSSQL but I would like to run an open source PHP app that uses MySQL. Forgive my DB ignorance, but is there a wrapper class or anything I could (easily) use without having to rewrite the entire open source apps DB code for MSSQL? Thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.