Jump to content

chupacabrot

Members
  • Posts

    17
  • Joined

  • Last visited

chupacabrot's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. or should i simply just add a simple iframe that leads to http://www.myothertestspace.com/simlpe2.php and refreshes it with the parameters when i click 'submit' ?
  2. im having a simple html form that gets variables via 'POST' and passes them to simple.php, the simple.php file constructs a new link with the $_POST[] - and all i want to do is creating a simple iframe (this script is only for internal uses) underneath the form that will open the new link that was created within simple.php to clarify it a bit more here's form.html <form name="Students Management" action="http://myowntest.com/simple.php" method="post" accept-charset="utf-8"> <p> <label>First Name</label> <input type="text" value="" name="firstname" ></input> </p> <p> <label>Phone</label> <input type="text" value="" name="phone" ></input> </p> <p> <label>Last Name</label> <input type="text" value="" name="lastname" required="true"></input> </p> <p> <label>Company</label> <input type="text" value="" name="school" required="true"></input> </p> <p> <label>Email</label> <input type="text" value="" name="email" ></input> </p> <p> <label>Country</label> <input type="text" value="" name="age" ></input> </p> <p> <input type="submit" value="Submit" ></input> </p> </form> and here's simple.php <?php $newUrl = 'http://www.myothertestspace.com/simlpe2.php?name=' . $_POST['name'] . '&surname=' . $_POST['lastname'] . '&phone=' . $_POST['phone']; header(Location: $newUrl); ?> now, all i want is - after the user 'submits' the details on form.html , i'd like a new iframe will be shown up in the same page as the form that will show the user the contents of simple.php (which means - myothertestspace.com with the new parameters). thanks a lot!
  3. Is there any reason why my questions aren't being answered? Am I rephrasing them wrong or something?... At least give me some further notes so i'll get a bit more effective in this forum.. I don't really find it as a hard question - And i haven't found an answer anywhere online so it could be great of you guys to at least tell me why i'm being ignored...
  4. " Each value there is a simple html snippet like '<a href=http://www.mywebsite.com/tes2t>testing</a>' ." Means that $arrinfo[0] = '<a href=http://www.mywebsite.com/' . $test2[0] .'>this is value . $test[0] .'</a>' $arrinfo[1] = '<a href=http://www.mywebsite.com/' . $test2[1] .'>this is value . $test[1] .'</a>' $arrinfo[2] = '<a href=http://www.mywebsite.com/' . $test2[2] .'>this is value . $test[2] .'</a>' $arrinfo[3] = '<a href=http://www.mywebsite.com/' . $test2[3] .'>this is value . $test[3] .'</a>' and so on..
  5. I realized that my previous question wasn't clear enough so i decided to open a new thread (hopefully the old one will be removed - sorry for inconvinience). Here's my question - I got an extern html form that passes a value to some php file that is called makelist.php - The makelist.php simply analyzes the data that was sent through the $_POST method and puts all the 'right' values in one string array that is called $arrinfo - Each value there is a simple html snippet like '<a href=http://www.mywebsite.com/tes2t>testing</a>' . Now, assuming that i have an existing wordpress page which is called 'test1' for example - How can i put -all- that links (snippets) that exist in $arrinfo into a new sub page which will be like www.mywebsite.com/test1/arrinfolinks/ ? Do i need to install any wordpress plugin that will allow me to insert PHP code within posts/pages? Or is there any way to do it externally out of my php code? I can definitely put my php files in the same directory that wordpress uses so i can use wp_insert_post() for example - but i just couldn't figure yet how to create a sub page and insert all $arrinfo's content into it so it will be shown as links and not plain text of html tags.. thanks in advance..
  6. Assume that $bandList is an array of strings , and i want to create a page with the whole list - function createWPpage($bandlist) { $link = mysql_connect("localhost","root","pass","wordpress"); if(!link) { die('Could not connect: ' . mysql_error()); } $sql = 'INSERT INTO wp_posts '. '(post_content,post_title,post_type) '. 'VALUES {'$bandlist','List of Bands','page'}'; mysql_select_db('wordpress'); $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not enter data: ' . mysql_error()); } echo "Entered data successfully\n"; mysql_close($conn); } Well, I got wordpress installed on localhost but for some reason it wont show any error or warning while trying to execute this code (turned E_ALL on) but on the other hand - it doesn't make any changes to the actual database.. am I missing something?
  7. I mean, every 'submit' button will respectively send a $_POST request to some other .php file that connects to a specific database of the desired wordpress and will use wp_insert_post there with the data that sent over the POST method?
  8. Conceptually i'm stuck (: I know i can insert post with wp_insert_post when im already in this blog - but how can i make it remotely? do i actually need to open multiple mysql connection to each wordpress database and then insert the posts?
  9. thanks! that worked perfectly!
  10. i am trying to extract all the anchor texts that have the _blank attribute but for some reason it won't work as i expected (shows a blank screen) - <?php require('simple_html_dom.php'); libxml_use_internal_errors( true); $url = 'http://www.siteforexample.com/example.html'; $html = file_get_html($url); foreach(($html->find('a[_blank]')) as $clz) echo $clz->innertext . '<br>'; ?>
  11. <!-- start of categories list --> <div class="categories en"> </div> <a href="../agriculture.html" target="_blank">agriculture</a><br /> <a href="../avantgarde.html" target="_blank">avantgarde</a><br /> <a href="../azyx.html" target="_blank">azyx</a><br />
  12. Hello, Is there any way to -remotely- insert a post to a custom wordpress URL? Assuming I have a network of 5 websites and i would like to update all of them through some form i'll build (may say - a mini CMS maybe). Site 1 - [Form for content] [submit button] Site 2 - [Form2 for content] [[submit button]] Site 3 - [Form3 for content] [submit button] ... and so on. And simply everytime i'll pust the submit button the Form3 content will go to a specific wordpress website, and same about Form2 and Form1. Thanks.
  13. well.. unfortunately it still doesn't work.. :\ <?php $url = 'http://www.mywebsiteforexample.com/categories.html'; $contents = file_get_contents($url); libxml_use_internal_errors( true); $doc = new DOMDocument; $doc->loadHTML( $contents); $xpath = new DOMXpath( $doc); $categorylinks = $xpath->query('//div[@id="categories en"]/a'); //please notice the space in the div's name - maybe that causes any trouble // loop through the links and echo the link text foreach($categorylinks as $link) { echo $link->textContent .'<br />'; } ?>
×
×
  • 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.