Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


wdvltalk Roundup June 2002 - Page 24

July 1, 2002

Is there any way to place items inside div tags side by side. What I am trying to do is place three sets of images on the "same line", but after closing a div tag you get a line break. Any help is appreciated.

  • It can be done with css fairly easily. CSS is somewhat de rigueur nowadays, but i suppose it's not for everybody, and I grant you that tables still work, but separating presentation from content makes for assured forward compatibility, easier maintenance, et plentibus cetera. see http://www.alistapart.com/stories/practicalcss/
  • Yes, you can coerce DIVs to line up side-by-side by assigning the CSS "float" behavior to your block level elements. "Float" removes a block element from the normal page flow and allows text and other objects to flow around it. With CSS inline, it could look like this:
    <div style="float:left; border:none;">
      <img src="abc.jpg" />
    </div>
    
    <div style="float:left; border:none;">
      <img src="xyz.jpg" />
    </div>
    
    <div style="float:left; border:none;">
      <img src="123.jpg" />
    </div>
    
    <div style="clear:left;"></div>
    
    The last DIV above, if given no size or color attributes should take up no space in the page but will put an end to the float characteristics.
    Block level elements can be floated left or right. Incidentally, float even works in NN4x. Whoa!

Is there an easy way to have a "Sorry" page (The page you have requested is no longer here etc etc etc.. and then have the user redirected to the homepage?

  • Basically, you want a custom 404 error page? It's really simple to set up, if you control your server you can do it yourself (tell us if it's Apache, IIS etc and you'll get guidelines on how to do it). If your site is hosted for you by a webhosting firm it's even easier - make your 404 page, then email your webhost and ask them to set the server up to use your custom page. It's easy for them to do.
  • How important is the SE placement to your company? Give that some thought.. If the SE is important you may want to invest sometime in making the new site transparent to the SEs - for example you do not want the SE to know that you are redirecting it/page is not found/or anything else that lets the SE know there is a problem with that page.. Even though you can get a page to display nicely to a person visitor if part of the response to of the page includes some sort of error code in the header this will kill you on the SEs.

    There is a program called "WebBug 5.2 HTTP Test Program Copyright (C) 1996-2000 by Aman Software" - this will display the HTTP for you so you can see what is going on.

I have some dates stored in MySQL as YYYY-mm-dd. I'm trying to pull that date and then change it to a more user friendly format such as Jan 3 2002.

  • The PHP manual says that date (string format [, int timestamp]) returns a string formatted according to the given format string using the given integer timestamp or the current local time if no timestamp is given. So where you are using $BeginDate it's expecting an integer number representing a date/time and not a string representation.

    The manual goes on to say "To generate a timestamp from a string representation of the date, you may be able to use strtotime(). Additionally, some databases have functions to convert their date formats into timestamps (such as MySQL's UNIX_TIMESTAMP function). "

    So to begin with I would try
    date('M j Y', strtotime($BeginDate))
    

Can someone please tell me how do I get this thing to send more than just the contents of the query box to me in an email....Please. It's sending me the subject in the subject of the email which is good but I'm only getting the details of the Query box - nothing else - no Full Name, Company, Email or phone no. How do I fix this?

Example Code:


 <%
 On Error Resume next
 Dim MyMail
 Set MyMail = CreateObject("CDONTS.NewMail")
 MyMail.From = Request.Form("FromField")
 MyMail.To = Request.Form("ToField")
 MyMail.Subject = Request.Form("SubjectField")


 MyMail.Body = Request.Form("FullName") & vbCrLf
 MyMail.Body = Request.Form("Company") & vbCrLf
 MyMail.Body = Request.Form("Email") & vbCrLf
 MyMail.Body = Request.Form("TelNo") & vbCrLf
 MyMail.Body = Request.Form("Query") & vbCrLf

 MyMail.Send
 Set MyMail = Nothing
 %>

  • Each of those statements replaces the previous value of MyMail.Body.

    You want instead:
    MyMail.Body = Request("Fullname") & vbcrlf & _
        Request("Company") & vbcrlf & _
        Request("Email") & vbcrlf & _
  • You're setting the body of the email to each field...not concatenating them. Build a string of the field values and set the body of the mail to that...
       <%
          On Error Resume next
             Dim MyMail, mailBody
    
             mailBody    = Request.Form("FullName") & vbCrLf & _
                           Request.Form("Company")  & vbCrLf & _
                           Request.Form("Email")    & vbCrLf & _
                           Request.Form("TelNo")    & vbCrLf & _
                           Request.Form("Query")    & vbCrLf
    
             Set MyMail     = CreateObject("CDONTS.NewMail")
             MyMail.From    = Request.Form("FromField")
             MyMail.To      = Request.Form("ToField")
             MyMail.Subject = Request.Form("SubjectField")
             MyMail.Body    = mailBody
             MyMail.Send
             Set MyMail     = Nothing
          on error goto 0                 ' reset error checking
       %>
    

wdvltalk Roundup June 2002 - Page 23
wdvltalk Roundup
wdvltalk Roundup June 2002 - Page 25


Up to => Home / WDVL / Forum / Roundup




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers