Jump to content

Jax2

Members
  • Posts

    282
  • Joined

  • Last visited

Everything posted by Jax2

  1. Hi all, I'm sure this has been asked before, and probably will be again, but could anyone tell me what a good way of getting some coding work would be? I know there is a freelancing section here on this site, but I'm talking more like in my own city, or even state ... I don't have the money to spend on advertising, and I'm not professional enough to be able to handle massive websites, but when it comes to personal, or small business websites, I'm perfectly able. I see all these web designers and php coders out there getting tons of work, and I'm stuck here taking what little I can get from people who already know me and what I can do. So, I'm open to any suggestions. I'd like to find more work, web sites, php backend administration, anything really.... I just need to find some work. Any good ideas where I should start?
  2. You were right, I was trying to add locations, not advertising_locations ... so I now have the following in my database: 9102 9, 10, 2 ... However, it's not going to be able to be read like that, is it? I mean, that is one number, not an array of numbers or will it be recognized as 9,10,2? So again, I need to figure out how to show those locations and auto-checkmark the correct checkboxes, for which I'll go back to your other post, if it can use the data as it currently is ... Thanks for the help so far 182, you're doing me a huge service here...
  3. Okay, this is where I'm running into a problem now. On the test page, everything showed up as perfect, but when I try and update the database with the new values for the check boxes (2, 8, 9, or 10, or any combination of), I am getting a blank variable. Using your method, I did the following: $contract_number = clean($_POST['contract_number']); // misc stuff not checkbox $ad_cost = clean($_POST['ad_cost']); // $monthly_fee = clean($_POST['monthly_fee']); // $additional_info = clean($_POST['additional_info']); // foreach($_POST['location'] as $value) { $advertising_locations.= $value; } Which I thought would add each number (again, 2, 8,9 or 10 or combo of) to $advertising_locations and insert it into the DB ... apparently not. Please forgive me, arrays are NOT my strong point here.
  4. That worked perfectly ... Question though, I am going to be adding the array to the database (not only displaying it) which shouldn't be an issue, however, is it pretty similar method to find out what is in the database under locations_selected and to show a checked checkbox for each one they've chosen? My client would like the check boxes to represent which location the customer has chosen for such and such, so when you look at the edit_info form, you'll see as many checkboxes as there are locations, and the ones they've already chosen should be checked ... know what I mean?
  5. Hi guys, I'm trying to sort this out ... I have a table with location_id and company_name and I'd like to be able to select as many of these combos as I can (I.e., location_id 1 = such and such company) ... I tried making a test form but it's not working correctly. Even if I choose 1 location, it is returning all 4 as having been chosen, as well as a mysterious 5th selection, when there's only 4 to choose from... I'd appreciate it if someone would be able point out my error(s)? Here's the test code: $sql="SELECT * FROM host_locations"; $result=mysql_query($sql, $db); $total=mysql_num_rows($result); while ($row=mysql_fetch_array($result)) { $id[]=$row['location_id']; $name[]=$row['company_name']; } $i = 0; echo "<form method='POST' action='testcheckboxes.php'>"; while ($i<$total) { echo "<input type='checkbox' name=location value=".$id[$i].">".$name[$i]."<br>"; $i++; } echo "<input type='submit' name='doSubmit' value='Go!'>"; echo "</form>"; ?> <br><br> <div align="center">Testing checkmarks</div> <?php $id[]=$_POST['id']; $name[]=$_POST['name']; foreach($id as $location) { echo "You chose: Location ID:".$location."<br>"; } ?> The first part shows up correctly at least: I get 4 checkboxes, all unchecked, with the company name beside them ... submit button below.
  6. Heh, I'm not storing them the same way... mine are stored as: 1270814400 ... it's not an actual TIMESTAMP sql field ... it's just varchar with time() inserted... Anyhow, I got it working, but I appreciate all your suggestions!!
  7. Okay. I found a solution. Keep it simple. (Gee, such a great saying)... Instead of messing around with conversions and trying to get this date to match that date out of a timestamp and BLA BLA BLA ... I simply added a new field: call_back_date, which is the same thing as the timestamp but in date format, so then when I want to find out if a date is the same, I can just use THAT record instead of trying to convert the timestring to a date and then compare. Problem solved
  8. I guess what would solve this problem is to figure out how to create a timestamp for todays date at 12:00am --- so 2010-04-09:12:00.00 but in timestamp format (1270814400)
  9. It won't, because the contact_next field is stored as a timestampe (I.e. 1270837382), not a date (I.e. 2010-04-09)
  10. I tried doing this btw: $now=date('Y-m-d'); $now2=time($now); contact_next=($now+86400); (for tomorrow) But unfortunately, it's still including the hours:minutes:seconds in that instead of just the date with a time of 12:00:00am
  11. Hi guys... I need to know how to do this, and quickly :/ I found a website where you could type in a date and it would give you the unix timestamp of that date at 12:00 am... For example, if you type in todays date (04 09 2010) you'll get 1270771200 I am inserting records into a database and I need to be able to find all records that have a callback date of a certain time. The problem is, as it is now, it is inserting the time of day as well, so the string could look like this: 1270837382 which would be 6:23 pm on todays date. I need to figure out how I would write it so that when it inserts the date, it is only inserting it as 12:00am on the day specified... (I use +86400 to add 1 day, +172800 for +2 days from now ...etc) Let me make it clear: I enter a new contact. I need to contact that person at a later date. I need the contact later date to be 12:00 am exactly 3 days from now. So I would take todays date (at 12:00am) and add 3 days, or 259200 to that timestamp ... This way, when I need to find all records for clients that need to be contacted on a certain day, I can simply look up that day at 12:00am exactly and find the records with no problem. If you are confused, PLEASE ask questions, I will explain better if I can ...
  12. Okay, let's see... contact_next field is varchar, 100 ... the date is selected in a form like this: <option value="<?php echo date('Y-m-d', strtotime('+1 day')); ?>">1 Day</option> <option value="<?php echo date('Y-m-d', strtotime('+2 day')); ?>">2 Days</option> <option value="<?php echo date('Y-m-d', strtotime('+3 day')); ?>">3 Days</option> ...etc on the processing page, it simply sanitizes the $contact_next and adds it to the database normally (insert into ... values ('$contact_next') ... so I am left with a varchar string such as 2010-04-08 So what I did was create a new date stamp above the query which reads as follows: $today=date('Y-m-d'); mysql_query("SELECT *,UNIX_TIMESTAMP(tstamp) AS tstamp FROM prospects WHERE contact_next < $today ORDER BY contact_next DESC "); It is returning records, but all of the dates it is returning are in the future, and its also not sorting the records by contact_next desc as I am trying to get it to. can you subtract a string (2010-04-01) from a date (2010-04-08)? I looked into str2date function and I can't make heads or tails out of it or how it will help me.
  13. I know it should have been done that way in the beginning, but they've already built their entire website around this as is ... So I'm pretty much stuck trying to figure out a way to use a string such as 2010-04-01 and finding out if that string is a date earlier than todays date of 2010-04-08 (which of course it is) ...
  14. Hi all, I'm working on a project and running into a bit of trouble. I have a field in the database that inserts a date generated by date('Y-m-d');, in other words, today would show up as 2010-04-08 ... I am trying to figure out a few things... for one, I can't seem to sort by this field. I'd like to sort it with the newest record first, down to the oldest, so I tried ORDER BY date DESC and it doesn't change anything. Second, I need to find ONLY the records where the date is previous to todays date, so I tried using this: $today=date('Y-m-d'); and then in the query WHERE date < $today ... which is ALSO not working. Suggestions?
  15. You can simply echo it, but you'll have to echo out your " or use ' instead, such as: echo "<p class='guidelines' id='guide_1'><small>Sample Tooltip Guideline</small></p>"; then it will echo that line.
  16. You were right, of course. Thanks! If I hadn't contacted my host to bitch at them already, that would have helped a lot
  17. I found the problem ... apparently dreamhost, in their infinite wisdom, deemed it necessary to prevent anyone from sending out more than 100 emails in an hour. Therefore, the first 324 I tried to send threw me over the hourly limit, and even though I was only trying to send 18 each time after, I was already suspended for the hour. What a pile of junk. Hope I never need to send out newsletters to more than 100 people at a time :/
  18. I have changed the $to email address to 3 different ones now, nothing helps.
  19. Hi everyone. I'm trying to help a client set up an email cronjob to send out emails telling his employees they need to contact a certain company each day, depending on the contact date. I wrote my script, tested it the first time and found out I had an error, and for each of the 18 contacts that had to be sent out today, I sent 18 of them... for a total of 324 emails. Oops. I corrected the error and tried it again and this time it sent me all 18 contacts just as it should. I tried it a third time and now it won't send anything at all, or at least, I'm not getting anything. I have tried removing the mail() function and simply echoing each thing onto the page, and I'm getting all the correct data ... (As in, $to, $subject, $body, $headers) ... they show up perfect, but if I try and mail them again, no emails are being sent. Here is the script. Some fast help would be appreciated! <?php include("includes/db.php"); $today=date('Y-m-d'); $from="XXXX@XXXXX.XXX"; $to="XXXX@XXXXX.XXX"; $subject="Contact call backs for ".$today.""; $headers = 'From: '.$from.'' . "\r\n" . 'Reply-To: '.$from.'' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $sql="SELECT * FROM prospects WHERE contact_next='$today'"; $result=mysql_query($sql, $db); $total=mysql_num_rows($result); if ($total<1) { die(); } ELSE { while ($row=mysql_fetch_array($result)) { $body=" ".$row['representative'].",\r\n The following company is scheduled for a call-back today, ".$today.".\r\n Company: ".$row['company_name']."\r\n Name: ".$row['firstname']." ".$row['lastname']."\r\n Address: ".$row['address']."\r\n City: ".$row['city'].", ".$row['province']."\r\n Phone: ".$row['phone']."\r\n Email: ".$row['email'].""; mail($to, $subject, $body, $headers); } } ?> Again, if I remove mail( and simply echo $to, $subject, $body, $headers, they all show up as correct. So, they SHOULD be getting sent out.
  20. Yep, I tried that one and it ended up giving me a page from hell that went down about a mile Here's a current copy of my css file: <?php include ("../includes/db.php"); $sql="select * from ".$prefix."configure"; $result=mysql_query($sql, $db); while ($row=mysql_fetch_array($result)) { ?> body { font: 100% Verdana, Arial, Helvetica, sans-serif; background: #<?php echo $row['background_color'];?>; background-image:url('../images/<?php echo $row['background_image'];?>'); margin: 0; padding: 0; text-align: center; color: #<?php echo $row['Text_color'];?>; } .thrColLiqHdr #container { width: 90%; /* this will create a container 80% of the browser width */ background: #<?php echo $row['MainBody_color'];?>; margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */ border: 1px solid #000000; text-align: left; /* this overrides the text-align: center on the body element. */ } .thrColLiqHdr #header { background: #<?php echo $row['HeaderFooter_color'];?>; padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */ border-bottom-style: thin; border-bottom-color: black; border-bottom-style: solid; border-bottom-width: 1px; height: 150px; } .thrColLiqHdr #header h1 { margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */ padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */ font-style:italic; } .thrColLiqHdr #sidebar1 { float: left; width: 220px; background: #<?php echo $row['sidebars_color'];?>; padding: 15px 0; margin: 5px o; } .thrColLiqHdr #sidebar2 { float: right; width: 23%; background: #<?php echo $row['sidebars_color'];?>; padding: 15px 0; .thrColLiqHdr #sidebar1 p, .thrColLiqHdr #sidebar1 h3, .thrColLiqHdr #sidebar2 p, .thrColLiqHdr #sidebar2 h3 { margin-left: 10px; margin-right: 10px; } .thrColLiqHdr #mainContent { margin: 0 24% 0 23.5%; background: #<?php echo $row['MainBody_color'];?>; border-left-style: solid; border-color:transparent; } .thrColLiqHdr #footer { padding: 0 10px; background:#<?php echo $row['HeaderFooter_color'];?>; border-top-style: thin; border-top-color: black; border-top-style: solid; border-top-width: 1px; } .thrColLiqHdr #footer p { margin: 0; padding: 10px 0; } } #members { width: 95%; padding: 10px; float: left; margin-top: 1px; } #members a:link, #members a:visited, #members a:hover { text-decoration: none; } #nav { width: 85%; padding: 10px; margin-top: 1px; float: left; } #nav li a#current { border-bottom: 3px solid #DAD6B7; background: #<?php echo $row['sidebars_color'];?>; } #nav a:hover { background-color: #<?php echo $row['menumouseon'];?>; color: #00000; } #nav a:link, #nav a:visited #menu1 a:visited { color: #000000; text-decoration: none; } #nav a { color: #000000; text-decoration: none; font-size: 14px; display: block; padding: 3px; width: 160px; background-color: #<?php echo $row['sidebars_color'];?>; border-bottom: 1px solid #eee; } #nav ul { font-family: Arial, Helvetica, sans-serif; list-style-type:none; margin:0; padding:0; } #nave li { display: inline; /* for IE5 and IE6 */ } .fltrt { float: right; margin-left: 8px; } .fltlft { float: left; margin-right: 8px; } .clearfloat { clear:both; height:0; font-size: 1px; line-height: 0px; } #usermenu { width: 100%; float: left; } #usermenu ul { list-style: none; margin: 0; padding: 0; width: 7em; float: left; } #usermenu a, #usermenu h2 { font: bold 11px/16px arial, helvetica, sans-serif; display: block; border-width: 1px; border-style: solid; border-color: #ccc #888 #555 #bbb; margin: 0; padding: 2px 3px; } #usermenu h2 { color: #000; background: #<?php echo $row['menumouseon'];?>; text-transform: uppercase; } #usermenu a { color: #000; background: #efefef; text-decoration: none; } #usermenu a:hover { color: #a00; background: #fff; } #usermenu li {position: relative;} #usermenu ul ul { position: absolute; z-index: 500; } #usermenu ul ul ul { top: 0; left: 100%; } div#usermenu ul ul, div#usermenu ul li:hover ul ul, div#usermenu ul ul li:hover ul ul {display: none;} div#usermenu ul li:hover ul, div#usermenu ul ul li:hover ul, div#usermenu ul ul ul li:hover ul {display: block;} <!--[if IE]> <style type="text/css" media="screen"> body { behavior: url(csshover.htc); font-size: 100%; } #usermenu ul li {float: left; width: 100%;} #usermenu ul li a {height: 1%;} #usermenu a, #usermenu h2 { font: bold 0.7em/1.4em arial, helvetica, sans-serif; } </style> <![endif]--> <?php }; ?>
  21. Hi all. I used dreamweaver (ugh, I know) to create a simple liquid 3 column+header / footer css stylesheet. I've edited it a bit and added/removed some parts that were either needed or not, but I'm running into a serious issue that I've tried to resolve in every way I could find suggestions on on the net. My columns do not stretch all the way to the bottom. Let me explain the situation first before you reply ... The style sheet ends in .php so that the admin can change the background colors of the header/footer, sidebar 1/sidebar 2, and the main content in the center, as well as the background, which is working perfectly ... until they change the sidebars to a different color than the main content. At that point, whichever of the three (sidebar 1, main content, sidebar 2) is longest determines the bottom of the page. Usually, that is main content, but many times, main content is shorter than the right side bar, and the left side bar is always the shortest, which leads to a very ugly page in the end. I need to figure out how to make each section equal the length of the longest section on any given page. I.e., if the right side bar is longest, the left sidebar will go all the way to the bottom instead of stopping where the content ends. I was told to try putting a left border with transparent color on the main content, didn't help ... sidebar on left still ended at end of it's content. I can't use faux columns because of the background color being able to be changed, plus, it's a liquid layout, so the widths change depending on the users resolution. I am desperately seeking any advice on how I can fix this. Thank you in advance, and if you need to see the css file for any reason, let me know.
  22. I have it currently set that way and I agree. In my admin section, the owner of the script can change all the colors Sidebars, header/footer, and main body can all be changed with 2 clicks... I rather like that feature heh ... Thanks for the feedback.
  23. Thanks again, pretty much confirms what I thought to begin with, but one can never be too safe Appreciate the feedback.
  24. It means that for some reason, your code that set's the database, username, password and host is missing or no longer correct. ... you need to connect to the database before you can pull information out of it.
×
×
  • 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.