Occasionally, I have a problem dealing with some of the special
characters from text authored in MS Word, and then pasted into a web
form. It seems that somewhere something bad happens and what
eventually gets put into mysql via php is not correct.
In particular, I have trouble with apostroph
I try to seperate the php code from the html as much as possible. So,
if a page is dynamic, have php figure out the dynamic parts first,
put them into variables such as $html, or $pull_down_menu, or
whatever. Then all that needs to replaced in the html is that
section. HTML coders aren't dumb
I've noticed this, too. There are at least two things you can do to
make them work...
print("Some text {$myhash['mykey']}\n")
or
print("Some text ".$myhash['mykey']."\n")
jim
>Hey there,
>
>sortta simple question... Is it just me or can't you access hashes within
>strings?
>This works...
>p
It looks fine to me. The only difference is that I use
Content-Transfer-Encoding: quoted-printable, which shouldn't make
much of a difference here. A very small misplacement of a newline
character or even a space can cause things not to work correctly.
Your best course of debugging is to send
Well, I just made a test program that nested 1000 if() statements and
it worked.
Just make sure you close all your curly brackets correctly.
IMHO, a large number of nested if else elseif statements indicate
poor programming design. Sometimes they are necessary, but usually
can be simplified
Try something like this...
$my_array = array(
"A"=>array("1","2","3"),"B"=>array("1","2","3"),"C"=>array("1","2","3"));
$num_columns = 3;
echo "";
foreach($my_array as $key=>$value) {
echo "$key";
for($i=1;$i<=$num_columns;$i++) {
echo "".$value[$i-1]."";
There are no shortage of ways to do this.
// Using explode() ...
echo array_pop(explode(" ",$full_name));
// Using split() ...
echo array_pop(split(" ",$full_name));
// Using stristr()
while($haystack = stristr($haystack," ")) {
$haystack = substr($haystack,1);
$last_wo
Try this in your form ...
>Can someone tell me how to pass a variable in the url?
>I am using a form and calling a handler file as its action, as in:
>
>
>
>I've also tried single quotes around the variable $login, as in:
>
>METHOD="POST">
>
>Anyone have any suggestions?
>
>Cheers,
>Steve
Yes, load time, but in general just to see how much traffic a
server/script/db can handle and what performance is like.
>Is this to test load time? To see under what load the script
>finially craps out, or the server?
>--- jimtronic <[EMAIL PROTECTED]> wrote:
>>
>&
Hi,
This may be more of webserver question, but what methods are used to
test the load on a php script or a family of scripts.
I'm guessing that apache (or equiv) would have a problem before PHP
under a heavy amount of traffic, right?
--
Jim Musil
-
Multimedia Programmer
Nettmedia
-
Wouldn't it be easier (better) to create a sendmail alias include
file that has all the addresses in it and let sendmail or majordomo
or qmail or whatever handle it?
I'm not knocking your method as much as I'm looking for the pros and
cons of the different methods.
jim
>the way I handle thi
I've seen developers use php to translate data into other languages.
Has anyone here done this?
Ideally, I'd like to be able to write or employ a function like this ...
translate($data,"english","french");
Obviously accuracy will be rough, but are there add on modules that
can do this?
--
http://php.net/array
Try $data = mysql_fetch_assoc($series)
This will produce an associative array with column names attached to
values for one row
of data from your database.
jim
>Hi,
>
>im trying to fill a chart with some data.
>
>I am using a mysql query:
>$query = "SELECT serie_tot, COUNT
You can also open a socket and put the files up via ftp. I use this
method frequently when I cannot move the uploaded files.
use the fopen("ftp://user:[EMAIL PROTECTED]/path/to/images","w";)
command to place the files.
This doesn't work so well if the file already exists, so you have to
dele
Presumably, each item in the catalog has a unique id of some sort in
the database. When you upload the images, you can rename the image
file to image_(unique_id).jpg. Then when you load a page, you can
reference the item next to the image.
This is only one way to do it, of course. You could a
It's good practice to check that needed variables were passed at the
top of the page.
if($name) {
normal display
exit
} else {
error display
exit
}
To take this further, you should verify that not only was the
required data sent, but that it was in the corre
It looks like you put a full URL into your include ... which would be
incorrect.
The syntax is ...
include("path/relative/to/your/script");
jim
--
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.n
Hi,
I've been having a problem moving uploaded files recently.
I have a script in directory
/foo/bar
and it has no trouble moving a file into
/foo/rex
but it can't move a file into
/foo/zip
This is strange because I created all the folders and the scripts, so
presumably they would hav
you could also do this ...
$data = mysql_fetch_assoc($res); //this is a nice function because it
returns an associative array. so
// if you change your SQL db, you
wouldn't need to change your php code
// as much.
$quarterbacks[$
switch {} will do it.
http://www.php.net/manual/en/control-structures.switch.php
>Could anyone tell me if there is a PHP equivalent to:
>
>SELECT x
> CASE 1 to 5
> {...}
> CASE ELSE
> {...}
>END SELECT
>
>Muchos gracias.
>
>Robin
>
>
>
>--
>PHP General Mailing List (http
When you perform the test you want to know if the $id is the user's
choice and if the user's choice is in the array.
Your code reads differently. You are checking to see if $id is the
user's choice OR $id is in the array. which would always check the
countries in the array.
>
You forgot the semicolon (;) after session_start()
> > This works fine, but now i made the files sessionstart.php and bottom.php
>>
>> sessionstart.php
>> --
>> > session_start()
>> if ($SessieEIA->Login == 1)
>> {
>> ?>
>>
>>
>> bottom.php
>> -
I'm sorry, your message doesn't make sense...
First you say that you want to do what the script is doing, and then
you say you don't want it to do that.
>i want to select the
>countries (check their checkboxes) if they are equal to a particular country
>variable I have set or if they appear in
23 matches
Mail list logo