Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Can Anyone Help Out A PHP Newbie?


Just now learning my way around PHP, and I'm having trouble with
something that I'm sure is a breeze for more experienced PHP coders.
Hoping someone can help.

I have a Web directory filled with text files that I need sorted
alphabetically. The details are:

· The files are numbered sequentially with a filename in the format
#.txt, such as 1.txt, 2.txt, 3.txt, etcetera.

· I need to sort them by a client name that appears in the first line
of each file. The files look like something like this:

XYZ Corporation
Aaron Winslow
Contacted
May 12, 2004
Entry Code 2355239

· It's crucial that the sorted files be renumbered sequentially, as a
report routine that pulls reports from the files freaks out if it finds
a missing number. They numerical order would have to match the
alphabetical order.

· All the files exist in a single Web directory with no other files,
so paths are not a consideration. And since there is nothing in the
directory but the files to be sorted, operations on the entire
directory are possible.

Can anyone suggest anything appropriate to accomplish this, even
something quick and dirty? I've been doing bubble sorts for years in
other languages, but I'm not up to speed on PHP enough yet to get it
working. I could probably be tacky and resort to doing it in
QuickBASIC, but who on earth wants to do THAT? ;-)




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Help With XML DOM Using PHP (XML Newbie)
I tried posting in the XML board, but there isn't much traffic there, so since I'm using PHP to use the XML DOM, I figure I'll try posting here too... sorry if this qualifies as a cross-post.

I've read through (skimmed, really) the PHP & XML articles on devshed, in the XML section... and I've been playing around with using the XML DOM, but have a few questions.

My XML document looks something like this:

Code:
<?xml version="1.0"?>
<SITE>
<SECTION1>
<PAGE1>This is the first page of section 1.</PAGE1>
<PAGE2>This is the second page of section 1.</PAGE2>
<PAGE3>This is the third page of section 1.</PAGE3>
</SECTION1>
<SECTION2>
<PAGE1>This is the first page of section 2.</PAGE1>
</SECTION2>
</SITE>

Now, I'm using the DOM to extract the root, and then list all of the children of the root. However, what's happening is that even though I have 2 children of the 'SITE' node, my code is reporting that there are more. I've checked the type for these other nodes, and they say they're text objects, but I can't figure out what they are.

Here's my code:

Newbie 2
Notice: Undefined variable: username in /home/fhlinux169/c/
clashoff.co.uk/user/htdocs/create_entry.php on line 11

Notice: Undefined variable: password in /home/fhlinux169/c/
clashoff.co.uk/user/htdocs/create_entry.php on line 11

Ive got a new error message please help.Am trying to setup userlogin
on my website.

This is the code:

<?php

mysql_connect("localhost","root") or
die ("Could not connect to database");
mysql_select_db("user") or
dir ("Could not select database");

if ($_POST['submit'] == "Register")
{
$query = "insert into users
(username, password) values ('$username', '$password')";
mysql_query($query) or
die (mysql_error());
?>
<h3>You are now registered</h3>
<a href="index.html">Go back to main page</a>
<?php
}
else
{
print("not registered");
}
?>

Newbie Pdf Problem
Fatal error: PDFlib error: function 'PDF_begin_page' must not be called in 'object' scope in c:inetpubwwwroot test.php on line 9

I have enabled the pdf.dll
I have 'write enabled' every file listed in phpinf();

Newbie: Xsl(xml)2sql2mysql
Is it possible to apply xsl to xml and produce sql insert statement
that will be used by php to insert data to mysql.

Newbie PHP/SQL Problem
I've install a supposedly compatible combination of PHP, SQL with an
Apache server. Generally all individual components seem to operate fine. I
can create tables in the database using mysql and I can run basic PHP code
in my browser using the Apache server. Everything's running on my desktop
PC.

However, whenever I use the mySQL related functions in my PHP, the php
script just stops. No error messages. Just nothing. For example, using
something like:

$conn = mysql_connect("localhost", "root", "") or die(mysql_error());

in my php just stops the script dead. Everything up to this line executes
but nothing after it. This appears to be the same behaviour as if I put in a
non-existant function call. So my question is, how does the php know where
to find the SQL functions?. Is there any configuration required?. All of my
components came out of a book (with CD) and have been configured as
suggested.

Cookie Newbie -- Please Help
I'm writing a discussion board app that will store a user's name in a
cookie after they log in so that for the duration of their visit to the
site and for a half hour afterwards, they will not have to log in again.
I realize that cookies must be sent in the header of a page before any
content, so on my 'write message' page, I have the following in the
header section, before even the doctype declaration:

PHP Newbie - Converting From ASP
I'm making the switch from ASP to PHP, and I'd appreciate it if someone
could tell me the equivalent of the following. I'm basically looking for
keywords to look up, but examples would be nice too. Any good PHP resources
for ASP people like me?
cheers.

Response.Buffer and Response.Flush

Response.ContentType = "text/HTML"
Response.AddHeader "Pragma", "no-cache"
Response.CacheControl = "no-cache"
Response.Expires = 0

If Len($title) = 0 Then $title = "the default"

and finally, this one:

$TheDate = Right("20" & Year(Now()), 4) & "-" & Right("0" & Month(Now()), 2)
& "-" & Right("0" & Day(Now()), 2) & " " & Right("0" & Hour(Now()), 2) & ":"
& Right("0" & Minute(Now()), 2) & ":" & Right("0" & Minute(Now()), 2)

Htmlspecialchar Newbie
I'm a little confused on where to place the htmlspecialchar. I have the
following form:

<form name="project" method="post" action="add_project.php">
<p>&nbsp;</p>
<table width="640" border="1" cellpadding="5" style='border-collapse:
collapse'>
<tr>
<td width="606" bgcolor="#CCCCCC"><div align="center"><strong>Create
a Project</strong></div></td>
</tr>
<tr>
<td height="131"><div align="center">
<table width="100%" border="0">
<tr>
<td width="33%"><div align="right">Project Name: </div></td>
<td width="63%"><div align="left">
<input name="pname" type="text" size="25">
</div></td>
</tr>
<tr>
<td><div align="right">Project Description: </div></td>
<td><div align="left">
<input name="pdesc" type="text" size="25">
</div></td>
</tr>
<tr>
<td><div align="right">Active:</div></td>
<td><div align="left">
<input name="active" type="checkbox" id="active" value="yes"
checked>

Newbie Looking Where To Start
After being a lurker in here for some time, I got the PHP bug, and
downloaded Apache 2.0, PHP 4.summat and MySQL

I installed, registered the dll's edited the conf files and finally got it
all working (i think) after a few nights of faffing about.

Now... where should i start? I know naff all about PHP or MySQL and would be
greatful if someone could point me in the direction of some tutorials to
start learning about PHP and MySQL.

I am from a programming background (visual basic) and have a welly load of
knoledge on relational databases so wheres the best sources...
Book/Web/Forums etc...

Newbie With IF Problem
The following code works. It's suposed to jump to start.php. If I
uncomment the comments then the code doesn't jump to start.php. Why is
this?

Do the IF's work from top to bottom or bottom to top? It's almost like
the uncommented code in the second section of code is being ignored.
Note that ob_start,session_start are in header1.php.

---------------- Code below jumps to
start.php------------------------------

<?php
include("general_scripts_etc/header1.php");
if (empty($_SESSION['site_name']))
{
ob_end_clean();
header("Location: start.php");
}

if (empty($_SESSION['site_logo_location']))
{
ob_end_clean();
header("Location: start.php");
}

if (empty($_SESSION['site_admin_email']))
{
ob_end_clean();
header("Location: start.php");
}

$_SESSION['email']=$_POST['email1'];

if ("a"=="a")
{
ob_end_clean();
header("Location: start.php");
}
/*
if ($_POST['email1']==$_POST['email2'])
{
ob_end_clean();
header("Location: enter_dob.php");
}
else
{
ob_end_clean();
header("Location: reenter_email.php");
}
*/
include("general_scripts_etc/footer1.php");
?>

-------------- Code below jump's to enter_dob.php if email1=email2 OR
jumps to re_enter_email.php ---------------------

<?php
include("general_scripts_etc/header1.php");
if (empty($_SESSION['site_name']))
{
ob_end_clean();
header("Location: start.php");
}

if (empty($_SESSION['site_logo_location']))
{
ob_end_clean();
header("Location: start.php");
}

Php Newbie Want To Use Php To Do The Following Things
I wanna use a textarea and a submit to transfer the text area into a
file.

and then the PHP program using a .exe program open this file,
processing the file, and save the output in another file

then PHP will open this file and update the html within the text file
and send to the customer

My question is:

if this possible?
what if the users input is not valid for the .exe file? how to analyze
this in php?
what if multiple users click this php file?

PHP Help For New Webiste.... Newbie!!!
This is my first post in this group so bear with me....

I am setting up a website where visitors will log in and input data
into their own particular fields. These fields will be viewable by
other members so I need to set up some access rights on the SQL
backend.

I have limited knowledge of PHP but have grasped a fair bit from
tutorials. I don't mind paying someone to get the PHP sorted but it is
going to be a free site so would like to keep costs to a minimum.

Also I would like to group members into groups?

Does this seem possible and how difficult would this be.

I will be using MYSQL and PHP

Newbie Mysql Help
Any way to retrieve data from mySQL database in the order of user input?

Example: select * from fruit_database where color='red' or color =
'blue' or color = 'orange'

I want this result:

apple
blueberry
orange

I don't want this result:

blueberry
orange
apple

Currently, my mySQL database is returning results in order of my Primay
Key Column. I'm wanting the results to be returned in the same order as
the user input.

Session In Php (newbie)
I'm trying to use sessions to preserve data across different
pages. I'm currently using apache 1.3.29 and php 4.3.1. My problem is,
when I store object in the session, when I retrieve that object in
other pages, it gives me an error stating that the object is not
complete. This is strange as I did it before and it suddenly gives me
this problem now.

[NEWBIE] Setting Cookies!
Hey,

I want to be able to filter the content of a page according to a username. I think the best way to do this is to set a cookie at the login page, taking the username, and then using that cookie as the criteria for my SQL statement in the query....

How do I set the username into a cookie from a form in a previous page? Can anyone show me the code that i would need to write into the form?

Displaying 10 Rows (Newbie)
I need help....I want to display 10 hits from my sql database.....

A function that wil select the first 10 rows of my database and then also provides me with a link to the script itself to diplay the next 10 hits (Or less, if there is no more).

Newbie Question About Functions
If I have a file that holds several functions and I include that file in my homepage will all of those functions get executed everytime the homepage is accessed or only when the function() is used in a particular page?

So for example if I inlcude the function file but don't use any of the functions or maybe just some of them in a particular page will all of the functions still get processed as if they were all called?

Php Cannot Be Installed On Linux - Newbie
I had to uninstall the php 4.2.2(that came along with linux
installation) to install 4.3.3 for some of my new applications to
work. The uninstallation went fine and the installation of 4.3.3 was
done in the following sequence after cd'ing into the php directory

../configure
make
make install

every thing seemed to go fine..

When i tried to see if package php is installed using
rpm -q php

I get the following message
package php not installed..

Newbie Question On !isset()
Below is the code from the book 'PHP By Example'.

I typed the code but it did not run the ELSE part. I believe the problem is
the $posted in 'if (!isset($posted))' because it is never defined in the code. Where should I define it?....

Newbie Limit Images Per Row
I'm building this little photo program. I store the image name in the database now when I query I want it to display 4 images in one row then go to next row if more then 4 images
PHP Code:

Newbie Needs Help To Fix Text In A Textarea
I'm a newbie needing help to fix imported text in a textarea i.e so that the
imported text in the text area cannot be changed in the web browser. Here's
the code snippet:

<p><textarea name="textarea2" cols="70" rows="7" wrap="virtual"><?php
include("contracts/termsandconditions.txt"); ?></textarea></p>

Newbie Array Question
I have a php form, where I want to "weed out" not-so-good customers. It
began with

if stristr('offensive_customer',$name) {
exit;
}

....then, over time, there were other form variables I needed checking,
and that list grew. Now it looks like this:
if (stristr('offensive_customer',$name) ||
stristr('offensive_city',$city) ||
stristr('offensive_customer2',$address) ||
stristr('offensive_customer',$address)
|| stristr('offensive_customer',$address) etc. etc. etc. you get the
idea) {
exit;
}

I then realized that the "$globals" variable holds ALL form variables,
so I was wondering if there is a more "efficient" and speedy way for PHP
to check.

Here is some "pseudocode," to clarify where I was hoping to go with
this:

$offending= array (
'bad_person',
'unwanted_city',
'bad_check_writer',
'bad_apple',
'etc.,etc.'
)
if (in_array($globals),"$offending") {
exit;
}

Any thoughts on this? Or, is PHP faster doing a large number of stristr
lookups using the "||" (or) operand?

[newbie]How To Chain Php Files?
I want to perform more then one task
after the web visitor clicked a link.
For example, one PHP file to update
the database, the second PHP file to
send the user an confirmation email.
How can I do it?

Newbie: How To Run Php From Command Line?
I need to test a script and want to do so on a Linux box (logged in via SSH from
another machine).

I tried creating a test script (called "test.php") like this:

#!/usr/bin/php
<?php
print "test";
?>

and tried running this from the command line like this:

../test.php

but nothing happens.

I also tried this:

../test test.txt

and the text in test.txt is this:

X-Powered-By: PHP/4.2.2
Content-type: text/html

Why is "test" not appearing in the test.txt file?

How do I get "test" to appear on my screen, rather than having to use test.txt?

Do I have to redirect STDOUT? How do I do this?


Perl -> Php PDO Newbie Question
I know I'm over looking something simple, so maybe somene here can help
me out.

I'm unsuccessfully trying to dereference an element of an array. I'm
trying to get the name of a PDO database column.

$rows->getColumnMeta($recNumber) will return an array with all my db
col details.

array(6) {
["name"]=>
string(2) "id"
["len"]=>
int(11)
["precision"]=>
int(0)
["pdo_type"]=>
int(2)
}
....
....

I want to be able to get the column name (name=>id) in element in 1
statement: Something like:

print "name = : " . $rows->getColumnMeta($recNumber)['name'] . "
";

But this does not work.
Instead I've been forced to use the much less elegant:

$tmp = $rows->getColumnMeta($recNumber);
$colName = $tmp['name'];

Header Location Newbie
I'm doing a relative URL redirect using this:

<?

header("Location: ../research/index.php?current=34");

?>

which works fine, except it redirects to the .org.uk version of my site
rather than the .org version.

Where does it get this from ?

Newbie - Trying To Set Up PHP To Work On My Laptop
I am just beginning to play with building and using PHP scripts for
some web pages I am working on.

I have installed IIS 5.0 and PHP but am trying to get just a basic
script to run. Unfortunately I cannot and the error I think I am
getting is

"HTTP 403.1 Forbidden: Execute Access Forbidden
Internet Information Services "

I have followed what I believe to be all the instructions for the
installation including modifying my php.ini to include

cgi.force_redirect = 0

The installation does talk about the following but I guess I dont know
how to do this and maybe that is my problem. It says:

"Set up the appropriate security. (This is done in Internet
Service Manager), and if your NT Server uses NTFS file system,
add execute rights for I_USR_ to the directory that contains
php.exe "

I have been playing around with security and what not but dont seem to
have the same options as indicated within the installation
instructions. When I right click on php.exe I dont get a security
tab. All I get is a General Tab and a version tab.

If I click on the folder I get the Sharing options. Next I clicked on
permissions and see user there but dont see I-USR. Do I need to add
that somewhere?

Newbie - Uploading File
I think it's the final question I have :)

How to make an 'upload' page where the user can upload something to me
(say, not larger than 1MB) and that should be stored in the 'upload'
directory. Or the current dir, nevermind, I can put upload.php in the
'upload' directory :)

Using Session Instead Of Passing Thru URL- Newbie
Sorry if I don’t explain all the terms correctly,

how can i change this code to accept a session for which week they
choose, with register_globals = on it worked fine, but my web hosting
site has changed register globals to off and I’d like to keep it off
and learn to program without passing variables in the URL.

for($i=1;$i<=17;$i++){
echo "<a
href='http://".mysite.com."/pool/make_picks_form.php?week=$i'>".$i."</a>";
echo "&nbsp&nbsp&nbsp&nbsp ";
}

So my question is how to add a session[‘chngweek’] so I know which
week they picked to view.

Global Vars - Newbie
I'm having trouble with a situation like this:

function func1() {
global $myvar;
$myvar = 10;
}

function func2() {
echo "$myvar";
}

func1();
func2();

For some odd reason, in func2() where I try to use the global variable
$myvar, it appears that the variable is not set. My reference manuals on
PHP are not very clear about the scope of global variables between
functions. Can you please clarify how I can use $myvar in func1(), func2(),
and the main body of the PHP?

Newbie Question - MySQL, IIS & PHP On XP Pro
I'm relatively new to MySQL and PHP and I was hoping I could get some help.
I have an OCR scanner that scans that scans invoices and stores them in .pdf
format. The OCR part of the scanner grabs the invoice number and customer
number from the invoice and places them into an index file stating the
location of the invoice image. My goal is to have an internal webpage that
will allow me to query an invoice/customer number and pull it onto my screen
for printing and or faxing. I've looked on the web and it looks like a lot
of people have had success with MySQL and PHP. Yesterday I installed IIS,
MySQL and PHP on my XP box and everything works great. The problem is that
I'm not sure what to do next and most importantly, how to do it. I know a
bit of HTML, but could I was hoping that someone could help me with the
PHP/MySQL portion.

Newbie Question: $_SESSION
i have done a lot of development using JSP, so i am used to being able
just to say session.put("whatever") and get it back on any page by
calling session.get("whatever"). i'm not seeming to grasp how the
session works in php.

(php version is 4.1)

i am trying

session_start();
$_SESSION['foo']="someValue";

and then on another page i try to retreive

session_start();//should resume existing session, no??
$foo=$_SESSION['foo'] ;

but $foo ends up having no value.

i am not passing any session id, but i thought that you didn't have to
if the browser is accepting cookies. something i noticed-- i have my
browser set always to alert me before accepting a cookie, and the page
i am working on is not generating any alert, therefore, it is not even
TRYING to set a client cookie. why?

unrelated question, is there no way to "declare" variables so that
they are checked at compile time? e.g., if i write
$foo=1;
$bar=$fooo+3;

i am accidentally creating a new variable called $fooo on the second
line through a misspelling, instead of using the variable i already
stored a value in. is there any way to avoid this, like in JSP?

Is_dir Problem (newbie)...
Using the following code...

$pathname = ".";

$dh = opendir($pathname);
while (($dirname = readdir($dh)) !== false) {
if (is_dir($dirname)) $dirs[] = $dirname;
}
closedir($dh);

echo "<pre>";
print_r($dirs);
echo "</pre>";

....I get a correct listing of directories under the current directory. For
any other $pathname, (e.g. "./MySub/", "/Temp", "AnotherSub") the only
thing returned is:

Array
(
[0] => .
[1] => ..
)

even though there are directories within those directories. I've tried
this on both Windows and Linux boxes - same results.

NEWBIE: PHP Login Security
I'm using PHP and mySQL to create a website. I currently have a
mySQL database which includes a table for username/password which is
checked by a PHP script when someone attempts to login. If a successful
login attempt is made the PHP script sends to user to a certain HTML
webpage, but I realise a malicious attacker could simply point his
browser to the HTML page and bypass the security.

Newbie MySQL Question
I have 2 tables (table_one and table_two) that I want to combine into
one big table called "table_new."

Both tables consist of 2 columns: "fruit" and "quantity" (see my "create
table" samples below so you can understand my complex table structure
:-) Of course, table_one might have some fruits in it that table_two
doesn't have, and vice versa:

For example, here's what table_one has in it:
pomegranites 6
grapes 12
apples 9

here's what table_two has in it:
grapes 4
apples 2
bananas 5
rasberries 38

I want to combine them, so table_new ends up with:
pomegranites 6
grapes 16
apples 11
bananas 5
rasberries 38

So how can I make table_new without giving me an error on duplicate key
errors? what would be the mysql syntax to combine both tables into one
big table?

CREATE TABLE table_one (
fruit varchar(100),
quantity int(5),
PRIMARY KEY (fruit),
KEY quantity (quantity)
)

CREATE TABLE table_two (
fruit varchar(100),
quantity int(5),
PRIMARY KEY (fruit),
KEY quantity (quantity)
)

Newbie DB Update Question
Is there anything wrong with this code? It's not updating the DB. The
variables hold the correct data because I echo them and it's OK. The
user has the grant for update...is this code OK?

.....
$update_url = "UPDATE howto_temp.url_pages SET page_url= $temp_url
WHERE page_id = $posted_pk";

mysql_query($update_url);
.....

PHP Page Is Blank For Newbie
phpinfo.php works just fine . php intro pages work just fine too
When the code below is posted the page appears blank does some one
have any ideas why a page will appear blank.

Php Editor For Newbie Recommendations?
I am learning php and have been trying different software to parse my php.
I've tried Zend Studio and Nusphere phpED and both of them I spent many
hours and failed to get the debuggers working. Can someone suggest an easy
to set up editor? My wish list (very modest)

1. wysiwyg preview when I run something that also contains html.
2. autocomplete php tags as I type.
3. show where the errors are when I run a script.
4. needs to work with a MySQL database.

I've also tried Komodo and PHP Expert Editor. Komodo couldn't get it to
parse anything in my browser, it only showed my page.php (verbatem) without
parsing anything. PHP Expert Editor (my favorite except for some short
comings) has no autocomplete that I could see.

Extreme Newbie -- Variables
is it at all possible that the book I
bought is wrong? I'm trying to do this:

index.php:

<HTML>
<head>
<title>PHP Test Page</title>
</head>
<body>
<?php
print("Hello. Your name is " . $name );
?>
</body>
</HTML>


Then, however, if I were to try to access the page, say by doing:
IP/index.php?name=Matt nothing happens. All I get is "Hello. Your name is".
So the variable isn't getting displayed (it's null?)

Anyways, if I'm to do this:

<?php
$name = Matt
print("Hello. Your name is ". $name );
?>

I get my name back. Please help. What am I doing wrong? I'm using Suse 8.2
Linux with the built-in PHP/MySQL/Apache servers. (I think that'll be
Apache 2.something with PHP4.) SQL doesn't have any role yet....but its
embedded in there somewhere.

Associative Array Question - Newbie
I am in the process of designing (before coding) my first serious PHP/MySQL application and I have a question about the best way to store information.

The application will allow users to view the voting record of different legislators. I have concluded that the most efficient way to store the data is in two tables: one that has details about each legislator (mp) and another that has the details of each piece of legislation (bill). Each legislators record will have a field that holds info in an associative array in the form (bill ID, vote result). This way, when a new piece of legislation is added to the database, one more value pair (bill ID, vote result) will be added to each legislators voting record field.

My question is two part:

Is this the most efficient way to store the data?

and

I suspect I will have to be using regular expressions to extract and format the data from the MySQL query. Are there some PHP or MySQL functions or syntax I would find useful in this process of retrieving the data? Any online tutorials? (mysql_fetch_array appears to create an array out of two fields - not really what I am looking for...) I realize this is a rather vague question, but if you have any suggestions, please let me know.

Select From Multiple Tables In Db From A Newbie
I have a db with 34 tables with all the same feilds, and would like to select 1 columb from all these tables. Is this possible from a select query, if so a example would be great.

You may well ask why have i 34 tables all the same, but i thought is was a good idea to set out the tables as per my catagories when i was constructing them. But now i know i can do them all from 1 table with multiple fields.

Newbie Needs Help With Ereg Regular Expression
I have to repost this to restate the question. No disrespect to the original
reply.

Please can someone help regarding providing a regular expression for entering
a set of characters with letters, numbers, periods (.), hyphens (-), or
underscores (_) only.

I need to do this using ereg

I've got as far as this but it doesn't quite work:

$pattern="^([a-z0-9.-_]{0,30})$";
if(ereg($pattern,$_SESSION['id']))
....

Newbie: Getting Index From Dropdown On Onchange Into Php Var
This is very new to me, scripting languages. I am trying to get the
/select id off of a dropdownlist, which really does not drop down and is
more like a flat list??, at an onchange event. Then move it into a php
var to retrieve different data from db. Not that it matters but I load
about 1200 items in to the list and was surprised how fast it is.

Could some one give me some direction?

//
// Handle the data coming back
echo "<FORM NAME=author>";
echo "<SELECT NAME=author_pk SIZE=20 COLS=20 ONCHANGE=getPK()>";
while ($rows = mysql_fetch_object($result)) {
echo "<OPTION VALUE=".$rows->id.">".
$rows->TITLE." ".
$rows->lastname.", ".
$rows->firstname.
$rows->middlename.
$rows->SUFFIX.
"</OPTION>";
}
echo "</SELECT>";
echo "</FORM>";
echo "<script language=Javascript>";
echo "function getPK() {";
<? $location ?=
"document.author.author_pk.options[document.author.author_pk.selectedIndex].value
";
echo "}";
echo "</script>";

Newbie Questions-- Syntax Error
I keep getting errors on certain pages. Where should I look for changes?

1064 - 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
'select a.*, pd.products_name from affiliate_clickthroughs a
select count( select a.*, pd.products_name from affiliate_clickthroughs a
left join products p on (p.products_id = a.affiliate_products_id) left join
products_description pd on (pd.products_id = p.products_id and
pd.language_id = &#391;') where a.affiliate_id = &#391;' ORDER BY
a.affiliate_clientdate desc ) as total
[TEP STOP]

Newbie Zend Studio And Extensions
Trying to use Zend Studio 3.5.2 on WinXP, have run into problems.

How do you add extension in this environment? Added soap by putting it
where it wanted it (c:/php5/*.dll). The various php.ini files have no
effect for setting extension dir.

Now it is complaining about my_sql not being there when clearly it is.

Was making excellent progress with XAMPP and Dreamweaver. But hit
brick wall with this product.

Newbie Question: Results By Page
How do I make results that I select from my database on different pages
based on length?

For instance, say I have over 50 records with more being added and I want it
to display 10 records per page. How do I get that info to display only 10 at
a time instead everything all in one page?

Index Page Query From PHP Newbie
index.html page I wish to have a link called "Today's message" that
contains a bit of PHP to fetch the message of the day.
I have this working from a daughter test page which has the extension .php.
When I implement this link from my Home Page I want the Home Page to still
be named index.html
How would I implement my desired operation?

Multiple Variables Set In A Cookie? NEWBIE
here is my situation;

We have a form that gathers some information from a user ( name, email,
street address), plus some samples of our product.

what i would like to do is set a cookie that will store name, email, and
what sample type they choose ( they can choose from one of three ).

My plan is that when the customer returns to the site, the product specials
will vary based on sample selections.

I had a couple of ideas of how to do this but would like some
feedback/advice from some pros.

1. A cookie sets name, email ( for list removal purposes), and sample type
choosesn, I tried this a couple times and couldnt' get multiple variables,
set to the cookie.

2. A mysql Database houses the customer data and a cookie sets the ID for
the customer ( which is automatically set from the db), when the client
returns the site reads the cookie of the customer entry, and recalls any
data that the site needs.

Newbie: If Then Statement And Expiring Listings
I've tried a couple of variations of coding this but i still haven't
gotten it down.

basically my query pulls all the tables within a certian search
criteria. When it shows the listings it shows a space like:

Name
Address
city, state zip
phone:
<blank space>
url

right now this is the code i have:


Copyright © 2005-08 www.BigResource.com, All rights reserved