Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 01-08-2006, 04:03 PM   #1 (permalink)
Rotkiv
Code Monkey
 
Rotkiv's Avatar
 
Join Date: Apr 2004
Location: Silicon Valley, CA
Posts: 64
Rotkiv is on a distinguished road
Send a message via AIM to Rotkiv Send a message via MSN to Rotkiv
anyone know a lot? question concerns php also.

'cause i need someon knowledgable to answer my question.

k here is my page i need help with.

the plan: a user types in a name in the text box, clicks "add new name" link as many times as he wants and enters as many names as boxes or not. user clicks submit and the names are put into a xml file which will be used imediately afterward, but that's a question for another time.

what's going down: by clicking "add new name" a new text box is added into the div tags innerHTML. I need to figure out a way to keep the users entry, but that's not my question, though if you want to answer that go ahead.

my question: can the names of the new textboxes be seen by php's $HTTP_SERVER_VARS thingy? I need to know just so i know if my php code is bad, or if it just won't work with my javascript.

to see the javascript it's list.js in the same folder.
thnx
Rotkiv is offline   Reply With Quote
Old 01-08-2006, 09:37 PM   #2 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
The inputs should come in as part of $_POST . You might try setting method="POST" instead of "post" if you're paranoid.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Old 01-08-2006, 10:11 PM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
Quote:
Originally Posted by Rotkiv
my question: can the names of the new textboxes be seen by php's $HTTP_SERVER_VARS thingy? I need to know just so i know if my php code is bad, or if it just won't work with my javascript.

to see the javascript it's list.js in the same folder.
thnx
PHP doesn't see anything until you press the submit button. Once you press submit, if you have created an 'name' attribute for that element, then you would be able to access that variable with: $_POST['myvarname']

Using javascript for this might be a little more complicated than you need it to be. If I were saving names in an XML file, I would use this logic:

- read the xml file into an array
- display the names in the file on the page
- at the top or bottom of the page, have a text box and submit button to add a new name
- write a function to add a new name to the xml file if one is submitted
- also write a function to delete a name from the xml file and have a 'delete' link next to the name to trigger it

i really don't know the scope of your project and this may completely not apply to it, .. but definately get a handle on the PHP/XML stuff you want to do before you get too deep into the javascript.
sde is offline   Reply With Quote
Old 01-09-2006, 10:21 AM   #4 (permalink)
Rotkiv
Code Monkey
 
Rotkiv's Avatar
 
Join Date: Apr 2004
Location: Silicon Valley, CA
Posts: 64
Rotkiv is on a distinguished road
Send a message via AIM to Rotkiv Send a message via MSN to Rotkiv
yeah, i'm trying to get into this whole "AJAX" thing, it seems to be a must have for web developers so i'm trying to get acquainted with all that crap at the same time. hey it's fun.
Rotkiv is offline   Reply With Quote
Old 01-09-2006, 10:50 AM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
you might want to check this out. it's not exactly writing your own from scratch, but it might be good if you want to work with a framework that is already made.

http://www.modernmethod.com/sajax/
sde is offline   Reply With Quote
Old 01-10-2006, 11:15 PM   #6 (permalink)
Rotkiv
Code Monkey
 
Rotkiv's Avatar
 
Join Date: Apr 2004
Location: Silicon Valley, CA
Posts: 64
Rotkiv is on a distinguished road
Send a message via AIM to Rotkiv Send a message via MSN to Rotkiv
so here's my next issue, what I've done here doesn't work on IE. Most javascript seems to not. I did a calculator and that works fine, but this one wont show up at all.

can anyone help me try to get my javascript to work with it?
Rotkiv is offline   Reply With Quote
Old 01-12-2006, 03:16 AM   #7 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 746
DJMaze is on a distinguished road
Quote:
Originally Posted by Rotkiv
i'm trying to get into this whole "AJAX" thing, it seems to be a must have for web developers
No it isn't, for example i hate AJAX due to the 'J' (javascript) things of it.
Keep in mind that many browsers allow you to disable JavaScript and not to mention the loads of IE's restrictions thanks to the many security issues with it unless you use P3P.
If you need something like AJAX think also about Flash and Java solutions.

Personally i just let people hit the [submit] button and provide them another form.
DJMaze is offline   Reply With Quote
Old 01-12-2006, 01:09 PM   #8 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
If you really want to do AJAX well it's best to take a while to study each component seperately before you try to combine them.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Make a search engine for your website with PHP zhisede PHP 3 10-25-2005 08:54 AM
PHP 5.0.4 and 4.3.11 Released sde Code Newbie News 0 04-20-2005 11:56 AM
PHP vs .NET Redline Lounge 1 11-24-2004 07:10 AM
PHP question I believe Ilya020 PHP 3 07-08-2003 09:08 PM
Question about a php prediction script(Great Site!) Geetazz PHP 15 06-12-2002 06:37 PM


All times are GMT -8. The time now is 03:12 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting