Jump to content

Create a POST from a PHP script - not html


liderbug

Recommended Posts

I'm working on bulk loading data into a DB.  The orig web page has the form, method=POST.  Works fine ... 1. i.t.e.m. a.t. a. t.i.m.e.  So I've figured out what I need to populate: $item = "Widget, red"; $quantity = 7; etc. etc. etc.  Which I can do in foo4.php and then call "insert_data.php".  However insert_data starts out with: $item = $_POST['item'];

 

What I can't figure out is how to POST item in foo4 before calling insert_data  :-\

 

Thanks.

cal

Link to comment
Share on other sites

insert_data.php is part of a larger package (zen cart).  In the larger schema the code runs thru files A,B,C,D,insertdata,F,G,(backto)A.  So I wrote foo4 to take the place of "D" which will have the lines: $data = file("data.csv");  foreach($data.... call insert_data.php.  I know it can be done - just a mater of getting all of the duck properly lined up.

 

cal

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.