Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - drewbee

Pages: [1] 2 3
1
General PHP Help /
« on: July 18, 2004, 02:57:04 PM »
Oops about the equal thing lol.

As well, now all results are being returned as 0,0 ??? Man what did i do this time lol...

Thanks for the attempt lig :)

2
General PHP Help / Incrementing the data correctly...
« on: July 17, 2004, 02:10:03 PM »
Hey All :)

3
Beginners - Learning PHP /
« on: June 19, 2004, 08:59:41 AM »
Simply do a query looking for the specific email address ie. SELECT email from blah where email = '$_POST['email'];

Then use [phpref]mysql_num_rows[/phpref]

if the values returned are greater then 0 then the email address already exists.
Look at these functions as well...
[phpref]mysql_query[/phpref]
[phpref]mysql_connect[/phpref]
[phpref]mysql_select_db[/phpref]

If you wrote that code above you should have no problem with this part.

4
Beginners - Learning PHP /
« on: June 19, 2004, 08:52:01 AM »
And another link...
http://www.htmlcenter.com/tutorials/tut ... m/155/php/

Basically to get it working on my host, all I did was went to the Cron Jobs and typed this in:

(lets pretend run at midnight a program called cron.php)

"0 0 * * * lynx -dump  http://mysite.com/cron.php"

I as well had problems connecting and got that same message when trynig to connect to mine as well. (when trying to connect through shell). So im not sure on that one.
Hope this helps!
Drew

5
General PHP Help / Server Setup
« on: June 13, 2004, 11:58:39 AM »
Hello all. I have sucesfully setup a server on my home computer with PHP, MySQL, and Apache. I am having one problem with everything though, It seems to come into affect when I use $_POST or $PHP_SELF

Register_Globals are on.

Notice: Undefined index: message in c:program filesapache groupapachehtdocsblanchardriveradminminutes.php on line 33

I get this message every single time a $_POST is called or a $PHP_SELF is called.

any ideas?

(Sorry for posting this in here... didn't think any other cat fit either. Thanks)

6
General PHP Help / Time to learn arrays... hmm
« on: May 28, 2004, 12:03:16 AM »
Well a quick question here. Basically I am trying to learn the concept of arrays, and this is what I am trying to do.
On the form page we have all our variables and are ready to be filled out. $_POST is the array created upon submiting the form right? No problem.

Now we make things a little more difficult. With each field name I want to use [require] and [norequire] IE
<INPUT TYPE="text" name="[require][name]">

Thus on the next page it would show up as
an array $_POST[require][name] As well as bringing in the rest of the fields, under each array, require and norequire. ( I hate multidimensional arrays)

My question is, when bringing out the data in the array, how do I keep the New Array Order the same as the order it was submitted from the form?

IE.

<input type="text" name="[require][name]">
<input type="text" name="[norequire][email]">
<input type="text" name="[require][phone]">
<input type="text" name="[norequire][content]">

This order will show up in the array like this, with two seperate arrays:
[require] [name] => bob
[require] [phone] => 555-5555
[norequire] [email] => bob@555.com
[require] [phone] => 555-5555
[norequire] [content] => blah


Ideas or suggestions? Or is this not possible? Basically What im trying to do is create a universal function that will take any submited information and insert it into the database, this would not be a problem if i didn't want to do error checking, but the error checking and throwing me into multi-dimensional arrays kinda throws me way off... any ideas or suggestions would be greatly appreciated!! Thanks,
Drew

A Fun little challenege indeed, but I need to understand how arrays work first.

7
General PHP Help /
« on: May 23, 2004, 11:38:35 PM »
Holy  :o

8
General PHP Help /
« on: May 23, 2004, 03:30:27 AM »
Aye,  I didn' t even think about all the "extra" stuff it will put in their for alignment and such... I will need to find out more information

9
General PHP Help /
« on: May 22, 2004, 04:51:36 PM »
alright. Lets see what we can do... how exactly do you read the file into a string using fopen... i am a little unfamiliar with it.

I do not have access to my server right now but here is my try where im at right now. let me know if their is something that should be changed... Thanks :)
PHP Code: [Select]

 
if ($_POST['submit_upload_file']) { 
        
$Temporary_File $_FILES['upload_file']['tmp_name']; 
        
$File_Name $_FILES['upload_file']['name']; 
        
move_uploaded_file($Temporary_File"temp/$File_Name"); 
        
$File_Open = @fopen("temp/$File_Name""b") or DIE ("Error Opening File");
        
$File_Read = @fread("temp/$File_Name") or DIE ("Error reading the file");
        
$File_Close = @fclose("temp/$File_Name") or DIE ("Error Closing File");
        
$File_Delete unlink("temp/$File_Name") or DIE ("Error Deleteing The File"); 
        
$_POST['event_description'] = $File_Read
        } 



with that, Should $_POST['event_description'] now contain the contents to the file?

10
General PHP Help /
« on: May 21, 2004, 10:17:39 PM »
reading and opening the file is no problem at all, its how it translates it. Its in binary format rather then ASCII and thus shows up with a bunch of symbols and stuff...

thanks for your help though :)

11
General PHP Help /
« on: May 21, 2004, 11:42:48 AM »
so pretty much im screwed. lol I guess im going to have to tell my client to use a different editor.

12
General PHP Help / File upload of .DOC... Interesting
« on: May 21, 2004, 01:07:16 AM »
Well, heres one for you all... Need to upload a file, and reprint it into a textbox. Ok thats no problem at all. The real issue at hand is when uploading .DOC's... it seems to do it in BINARY format... any ideas on converting or what to do?

PHP Code: [Select]


	
	
if (
$_POST['submit_upload_file']) {
	
	
$Temporary_File $_FILES['upload_file']['tmp_name'];
	
	
$File_Name $_FILES['upload_file']['name'];
	
	
move_uploaded_file($Temporary_File"temp/$File_Name");
	
	
$Read_File file_get_contents("temp/$File_Name");
	
	
unlink("temp/$File_Name");
	
	
$_POST['event_description'] = $Read_File;
	
	
}

13
Beginners - Learning PHP /
« on: May 15, 2004, 02:46:33 PM »
what is the rest of the code?? Either that, or your server is down. :)

14
General PHP Help /
« on: May 13, 2004, 11:00:54 AM »
arrays can be manipulated in a vast majority of ways...

[phpref]array[/phpref]
it can be sorted front to back, back to front, things can be replaced, things can be removed... very similar to a tempoary row in a database... Thats how I would reference it anyways....

but if i am understanding this correctly, why can you not order it by distance when you make the original pull?

15
Beginners - Learning PHP /
« on: May 13, 2004, 10:54:06 AM »
Im confused as to why their are double quotes on the inside of the global variable anyways? Those are suppose to be single quotes, right?... Try this...

$handle = @fopen("articles/{$_POST['name']}", "w");

Pages: [1] 2 3