scriptygoddess

Archive for the ‘Script snippet’ Category

17 Sep, 2003

Basic MySQL connection and query with PHP

Posted by: Jennifer In: Script snippet

I use this almost on a daily basis, and yet I can't commit it to memory. So I don't have to go searching for it each time I need to write it… $databaseName = "YOURDATABASENAME"; $dbconnection = mysql_connect("localhost", "DATABASE-USERNAME", "DATABASE-PASSWORD") or die ('I can?t connect to the database.'); mysql_select_db($databaseName,$dbconnection); $value = "SOMEVALUE"; $query = sprintf("SELECT […]

09 Sep, 2003

Date Time

Posted by: Jennifer In: Script snippet

Just wanted to store some code I use a lot and am tired of looking up 😉 In some of the scripts I work on, I create a field for a timestamp. For that field I insert the PHP value: time() When recalling that value, it's just an ugly looking UNIX timestamp, so to format […]

Comments Off on Date Time

Guest authored by
Patricia – lunanina.com/musings/

16 Jul, 2003

Get an email when Google visits

Posted by: Jennifer In: Script snippet

Guest authored by
Jayant Kumar Gandhi – wirez.f2o.org/coffee-house/

17 Jun, 2003

Reset Skin Preference Cookie

Posted by: Jennifer In: Script snippet

Guest authored by:
Kevin Donahue – blog.kevindonahue.com

10 Jun, 2003

PHP: What's coming in from the form?

Posted by: Jennifer In: Script snippet

I posted how to do this in ASP, but since I needed something similar in PHP for that last post, I thought I'd post the PHP version as well. This script snippet will play back everything that was just submitted in the form (code found in the each function page in the PHP manual.)

10 Jun, 2003

Secondary form that populates a main form

Posted by: Jennifer In: Script snippet

Let's say you have some optional items to your form. (Maybe extra address info) and your form is long enough as it is. You can pop up a secondary form, where the user can enter their extra info, and have it saved to the main form and submitted with the main form. (see example here)

I talked about stored procedures here the other day. Today, I needed to create a page that would call one of those stored procedures (the selecting one) and display all data from a table. This code is very plug-and-play-ish – very little needs to be modified (that is, as long as you're using MS SQL […]

31 May, 2003

writing and using stored procedures

Posted by: Jennifer In: Script snippet

I've been learning about stored procedures and calling them from ASP pages. So just wanted to jot down some examples/templates… (note from my technical editor, Mike: This code is specific to MS SQL Server and probably wouldn't work with other databases.)

Comments Off on writing and using stored procedures

15 May, 2003

ASP: What's coming from the form?

Posted by: Jennifer In: Script snippet

A simple little ASP snippet. If you want to see what's coming over from your method="POST" form – here's a bit of code that will loop through everything, show you the variable name and it's value: for each x in request.form() response.write(x & ": " & request.form(x) & "<br>" ) next if you're using method="GET" […]


Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements