Jump to content

help iterating through arrays and hotlinking


hackypro

Recommended Posts

phpshitvh4.jpg

 

ok so this php code here is what i have for processing a html page full of user input. the input is random and stored in arrays. however i'm not sure how to use the foreach method to scan arrays, and print the data within the table. as it is, each table cell just says array.

 

also i need to figure out how to link back to the page in which the data was entered, which is also random. i think i need to use a $_SERVER command but i'm not sure which one and under what syntax.

 

yes i'm a nerd. no i'm not a smart nerd. yes thats a terrible predicament to be in. whatever. if you can help i'd send you all my e-props.

Anytime your dealing with arrays and you end up with ARRAY or array when you echo out something, then your dealing with multi-dimensional array, and you have to loop again inside the other loop.

 

Here is a nifty piece of code to see what your array contains.

 

<?php
echo <pre>; 
   print_r($ArrayName); 
echo </pre>';
?>

 

Just wondering why the request_method part. You should know how the form is submitted... right??

 

Nate

no actually this is all for a sql class and the code needs to be written so that the source document is unknown. therefore it could either be sent by GET or POST.

 

no offense but /\ that means that your read array commands don't really help me. i'm only supposed to display the name of the field and the user input entered, not knowing what the actual info is.

 

i know i need to use a foreach method to read through the array, but i'm not sure how. also my hotlink issue is still unsolved....i dunno thanks for trying though

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.