User Profile

Collapse

Profile Sidebar

Collapse
akristof
akristof
Last Activity: Mar 14 '13, 03:07 PM
Joined: Nov 28 '11
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • akristof
    replied to file_get_contents not working -- sometimes
    in PHP
    Thanks...I know it's not the token...like I said, the API call works fine when I do it in the browser.
    See more | Go to post

    Leave a comment:


  • akristof
    replied to file_get_contents not working -- sometimes
    in PHP
    Code:
    $link='http://xyz';
    $token='xyz';
    $request='http://www.xyz.com/api/article?token='.$token.'&url='.urlencode($link);
    $response = file_get_contents($request);
    Where XYZ is actual values obviously.
    I spoke with the API provider and they say no changes on their side.
    I haven't done anything to my server..not sure if the provider did something? But like I said, the same code works fine on another...
    See more | Go to post

    Leave a comment:


  • akristof
    started a topic file_get_contents not working -- sometimes
    in PHP

    file_get_contents not working -- sometimes

    Okay, here's a puzzle worthy of Sherlock Holmes.

    There's an API I am working with in PHP by fetching the contents of a GET request using file_get_conten ts($url), where $url is the API request.

    Here are the facts of what is and isn't working for me.

    1. The main problem (and reason I am asking this question) is that I get a timeout on the file_get_conten ts
    2. However, when I run the API call in the...
    See more | Go to post

  • akristof
    replied to Pipe an email to a PHP script
    in PHP
    Sorry..I'm not sure I understand. Where does this go?
    See more | Go to post

    Leave a comment:


  • akristof
    started a topic Pipe an email to a PHP script
    in PHP

    Pipe an email to a PHP script

    I set up an email address on my server "post@domain.co m" and I want every emailed received to be sent to a php script, call it script.php.

    My hosting service uses CPanel11, where their forwarding function allows to pipe an email to a program.

    I set it up as
    |/home/ubitig/public_html/script.php

    And the on top of that file I say
    #!/usr/local/bin/php -q

    And I changed the permissions...
    See more | Go to post
    Last edited by akristof; Jun 22 '12, 12:19 PM. Reason: clearing up the formats

  • akristof
    started a topic Scheduling tasks such executing a php script
    in PHP

    Scheduling tasks such executing a php script

    I have a php script that sends out an email newsletter and I'd like to be able to schedule it to be executed once a week. I don't know unix so cron is out of the question. I was hoping for some GUI handling of this. Unfortunately my host doesn't have one. Unless you can tell me what the script would look like in cron to call a .php file on my domain. Any help is much appreciated.
    See more | Go to post

  • akristof
    started a topic How to query XML data? Move data to MySQL or xQuery?
    in PHP

    How to query XML data? Move data to MySQL or xQuery?

    OK since my post was moved to a new thread let me add some context :)

    I was asking about help with figuring out how to go about implementing xQuery or mySQL to analyze large datasets.

    At this point I am very good at data management using XML and manipulation using PHP (and then displaying the data back to the user using the XMLHttpRequest object in Javascript).

    While XML was super intuitive and easy to learn...
    See more | Go to post
    Last edited by akristof; Apr 15 '12, 11:12 AM. Reason: seperate question, requires new thread.. adding context

  • akristof
    started a topic using session variables in my javascript
    in PHP

    using session variables in my javascript

    I'm relatively new to coding so forgive if this is dumb. I have a page built in html/css/js/php. I want to add in some user functionality. I figured out how add a simple login mechanism, start sessions and carry variables, such as user's name/id, between pages.

    My question is twofold:

    a. Sessions being a php concept does every page I want to use session data in have to be a .php page? Everything I have written so far...
    See more | Go to post

  • akristof
    replied to DIV madness - float/relative/absolute
    Thx..my problem is that I was it to out of the flow with respect to everything else on the page but in the flow with respect to the element I want it to be next to (just to be able to position it on the page properly)..
    See more | Go to post

    Leave a comment:


  • akristof
    started a topic DIV madness - float/relative/absolute

    DIV madness - float/relative/absolute

    Basically, I have been scratching my head about how to accomplish what gmail does in this picture



    Specifically the div that pops up when you click "More"

    Generally the problem is, how do you position a div to make it float on top of all other divs but still be positioned relative to a specific div (I know how to make a div display on top on all other divs in absolute terms .. and even in relative...
    See more | Go to post

  • the frustrating thing is that for something this basic (ie, php data pulled in from a form via POST won't automatically work as an index number because it needs to be converted into an integer first) you would expect it to be spelled out somewhere and yet i basically had to figure that out on my own .. i have yet to find one reference source that is comprehensive about all these things // *whine*
    See more | Go to post

    Leave a comment:


  • thanks much!! the problem was somewhere else entirely - turns out that the variable i was pulling in from a FORM came in as a string and after i converted it into an integer everything worked perfectly

    i feel a bit dumb..but hey, 2 weeks ago i knew nothing about coding and here i am talking about XPath .. lol
    See more | Go to post

    Leave a comment:


  • yes i made the mistake in my description of the XML file..what i had in mind was a structure like what you said, ie

    Code:
    <parent>
    <child> 
    <grandchild> abc </grandchild>
    <grandchild> def </grandchild>
    </child>
    <child>
    <grandchild> 123 </grandchild>
    <grandchild> 456 </grandchild>
    </child>
    </parent>
    ...
    See more | Go to post

    Leave a comment:


  • that's fair! i thought this might be a general problem that someone might have encountered before.
    See more | Go to post

    Leave a comment:


  • //child[n]/grandchild[2]

    this is assuming first child has n=0

    does that seem right?
    See more | Go to post

    Leave a comment:


  • PHP/forms: refreshing page with new results after submit

    I am using PHP to edit the contents of an XML file based on user input in a form..the contents of the XML file are dynamically displayed on the page using XMLHttpRequest

    In my PHP I use "header('Locati on:abc.html');" to reload the page after the form is submitted and PHP script runs

    The problem I am running into is that the first time I load the page in a session (and ONLY the first time), the data displayed...
    See more | Go to post

  • thanks D.. so if the structure of my XML is

    Code:
    <parent>
    <child1> 
    <grandchild1> abc </grandchild1>
    <grandchild2> def </grandchild2>
    </child1>
    <child2>
    <grandchild1> 123 </grandchild1>
    <grandchild2> 456 </grandchild2>
    </child2>
    </parent>
    how would you access the...
    See more | Go to post

    Leave a comment:


  • using a variable to get the node number in simpleXML

    how does one refer to a node in XML when the node number is a variable?

    name[0] will return the value of first node with the name "name"

    how would I refer to the value of n-th node?

    or is it not possible to make a variable reference to a node in xml in php?

    thanks much
    See more | Go to post

  • akristof
    replied to trouble with php/xml edit via form
    in PHP
    here's what ends up being displayed in index.php.. the last line with
    "----- 1 votes" is the redundant stuff .. no idea how it got there!!

    swimming ----- 2 votes
    running ----- 3 votes
    Jogging ----- 4 votes
    swimming ----- 1 votes
    ----- 1 votes
    See more | Go to post

    Leave a comment:


  • akristof
    started a topic trouble with php/xml edit via form
    in PHP

    trouble with php/xml edit via form

    Hello
    I am trying to use php to add nodes to an xml file based on user input
    The problem is that the xml ends up having data inserted into it in addition to the data I asked the php to insert

    Here are the codes:

    for SAMPLE.XML
    Code:
    <?xml version="1.0"?>
    <list>
        <activity><name>swimming</name><votes>2</votes></activity>
    ...
    See more | Go to post
No activity results to display
Show More
Working...