Fetch & Process
I doing a straight forward webpage fetch and saving it to a file: CODE:
$open = @fopen($url, "r");
$urlfile = @fread($open, 50000);
@fclose($open);
$page = split("",$urlfile);
$datafile = fopen($tempfile, 'w');
foreach ($page as $line) {
echo($line);
fwrite($datafile,$line); }
fclose($datafile);
So I basically just write the fetched HTML line by line to a local file. The weird thing is I'm getting a bunch of ^M characters in the final file after every $line is written to the file.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Fetch?
If I want to retrieve a single row. I would make a query and than use msql_fetch_row. (If I use this in a loop it will fetch the next row until it becomes false). If I want to retrieve multiple rows. I would make a query and than use msql_fetch_array etc.. Say I use a loop with msql_fetch_array and display the data in a table do I have to make a new query to display say the third row of the original table somewhere else on the page?
Fetch A Php File
In my HTML I want to fetch a php file (the php file is a form for a user to fill out) but I want the form pasted on my page but instead it ries to open the form page in a new window of it's own... I tried href but also include.. I don't know that I am using the include properly.. any ideas?
How To Fetch The Structure Of A Table
Well can anybody tell me how to fetch the structure of a table and also the values specified for a patiular field type. Well what i exactly want is to retrieve the value set for teh enum field but have no idea as of how to get that values.
Select On Updated Value During The Fetch
Hi i have a table with all value at 4 i select all lines in a fetch i update one with a value of 7 i update all the row in the fetch with a value 5 the result is that all my row are at 5 and the only line which should be at 7 is at 5 too. i see that the problem is at the first mysql_db_query, and i don t know how to solve it $query="SELECT * FROM val WHERE str=Ɗ'"; $result=mysql_db_query($datamysql,$query); $query7="UPDATE val SET str=ƍ',updated=Ƈ' WHERE val=ƈ'"; $result7=mysql_db_query($datamysql,$query7); while ($row=mysql_fetch_array($result)) { $str=$row["str"]; $val=$row["val"]; $query2="UPDATE val SET str=Ƌ' WHERE val='$val'"; $result2=mysql_db_query($datamysql,$query2); }
PHP Fetch 6 Letter Strings
How would I go about fetching only 6 letter and more words from my string. Say the string was from a database, and is formatted like this. Code:
If Fetch Array Is Empty ?
I'm doing a fetch_array and I would like to display a "no records found" message to screen. For some reason this is not working: here's my Postgres SQL as proof: surveys=# select othermore from table where othermore <> '' othermore ----------- (0 rows) Then I have: $result = pg_query($conn, "select othermore from table where othermore <> ''"); while ($row = pg_fetch_array($result)) { if (!$result) { echo "no records<br> "; } else { echo "$row[0]<br>"; } } Strnage ? Can someone shed some light on what UI am doing wrong ?
Fetch Url From Html File
basically this is no problem at all as i can use regex etc. etc. what i want to do though is: fetch the url from the source of a html file (still - no problem here) which is online in the web (the problem begins). the most simple way (imho) would be to essentially just do an PHP Code:
Fetch The Date From Timestamp
i have a mysql table with 3 fields 1.id 2.time 3.approved values 1 1181237691 0 2 1181237703 0 3 1181237711 0 i want to fetch the distinct dates from this timestamp values using select statement. i want to display like this 1 2007-06-07 second thing i want to update the approved value=1 where these distinct dates are equal to the above timestamps.
Using Mysql To Fetch And Display Document
I am currently building a library on the web, this library will consist of pdf-files, at least for now. To keep track of these files, I of course wanna use mysql to keep the information. The whole library itself is supposed to be viewed on a page, where you can sort the titles alphabetically, by author, year, etc. The library will be completed with a fileupload-utility at a later time, but for now I just want to be able to display all titles from the db, that also should turn into a hyperlink. How do I do that?
Fetch Maximum Amount Of Chars
I want to fetch a maximum amount of chars, 10 in this case, from my mysql dbase with php. For example: If there is 'Post new topic for forum' in the table, I want to output it to the screen like this: 'Post new..'
Fetch Row Data Where Column Value True
I am looking for some guidance here with something I have driven myself nuts over. I have a MYSQL table that holds site variables in three fields, a "varname" field, an "id" field, and a "value" field. I would like to fetch the "value" field where the "varname" field is true. Example Rows: ID=1 varname=title value= My Website Title ID=2 varname=url value= http://www.mysite.com I would like to add the value into a template by using the code: $setting[title] or setting[url], etc. Can anyone tell me how I go about fetching a row ov values where a specific coumn value is true?
Function To Fetch Database Results
I have a function that is supposed to fetch all the results from my table "games". There are two database records in that table. My function is supposed to display all of the records, but it only displays one. I also use a function to display a certain template. Here is the coding for both functions and my index. Code:
V(oice)XML/MySQL/PHP, How To Fetch Out Variables ?
I have a question (hopefully someone in here have worked with VXML and server scripts with a back-end database). How do i write the php code that fetch out the variables i am storing in mysql with vxml tags ? I have tried (using bevocal cafe) the code below, but without any luck(i am sure there is something with the echo/print statment) Code:
How To Access Value's From The PDO Fetch Command
I am using the PDO fetch command to return a vlue from the database, now the problem I am having is being able to access the value, $bob = $result->fetch(PDO::FETCH_ASSOC); print_r($bob); When I print it out on screen I get Array ( [assessmentID] => 1 ) If I try $bob[0] it return nothing, any ideas?
Mysql Fetch With Drop Down Menu
Im trying to do somekind of dropdown menu taking information from the database but im not quite sure how this could be done with my knowledge. alright so lets say i have a table named: projects SELECT name FROM project. and it will put all the data found in a html drop down menu?
Using If/else Statments To Fetch Avatar From Mysql Db
i want to fetch a value from my user database table for the current logged in user. Then using the conditions, if $X equals 0 echo the default avatar location, else get the location from avatar_loc field and echo the avatar. Code:
Database Connections To Fetch Data, Best Practice?
I have many classes that use database connections to fetch data and manipulate on it. I also have database abstraction class that is handling all the database queries and so forth. Usually all my classes take instantiated database object as the first parameter to constructor so they know what database to use: ...
Mysql Fetch Array - Image Display If Available
I am using a HTML search form to give me the following result. I can get everything to work, even get it to display images that are associated with particular search term, but can't figure out how to keep it from displaying that annoying little "There's not image here image" that explorer shows, the one with box and red "x". I know that an if statement would do the trick, but I can't do "if's" inside of the "echo" is it possible to accomplish this? How? Code:
Process ID
I am starting a process with the system command via a php page. I want to put a button on the same page which will let the user kill the process by clicking that button. To do this, I need to know the process ID. I could grep for it, but that also returns the grep command. How can I make PHP tell me the process ID of a process I started? It seems as if this would not be a problem but I guess I am missing something.
Run Process In Background
I want to run process from my php script in background. I try different functions from functions list but all of them whaiting for process ending. How can I run `wget -b ...` and finish my script, but wget must still working? I use PHP5, Linux, Apache2.
Multithread A Process
can i use php to multithread mail() or something similar? in my company i need to send multiple copies of email to a few hundred ppl affilated and on my list. instead of calling mail over and over again i would like to thread this process. could someone point me to some documentation or perhaps an example of where to start with this?
PHP Process Problems
I'm having problems with php process in win2k. I have apache+php intalled on a win2k machine and after some use I can find 1,2 or 3 non-terminated process in the system. I try to kill them but I receive access denied (even logged as administrator :confused, and I have to reboot the machine. While I have 1 non-terminated process, I have no problems. But when it reaches 3 process php scripts doens't work anymore. If I try to load a page, it doesn't execute the scripts and the browser keeps waiting forever. What maybe the problem? Why can't I kill the process?
Process Form Fields
Hi, I need to process a generic html-form. Is there any way to access to the form elemts as an array?
Payment Process Through Nobel Pay
I am in photo business site. is their any one done any credit card payment process through nobelpay(one of the payment process like paypal, surepay etc..) in php. If any one have come across this payment process in php. please tell me how to implement the credit card payment process in php using nobelpay payment.
Does PHP Process Requests Sequentially On One CPU?
With ASP.NET I've found that request are processed sequentially, one at a time, at least on a server with one CPU. If one request blocks for some reason, maybe on a long database query, then all users must wait until it completes, for their request to process. This leaves me wondering about PHP running on IIS and Window. Does this hold true for PHP also? What about PHP on Unix? Does this allow true simultaneous processing of all requests when the server has a single CPU?
Oracle + PHP + Long Process
Oracle 10g RAC on Linux, with an end-user interface via Apache/PHP/AdoDB on a separate Linux box. I need to create a PHP web interface to allow an end-user to run a PL/SQL stored proc that will do a force refresh of a series of materialized views following the loading (through another PHP interface) of additional flat file data into the underlying tables. I want to allow multiple data uploads and then do a single refresh, so I won't be able to use fast refresh or other internal database trigger mechanisms. My real problem is that the time taken to execute the stored proc is likely to considerably exceed the max script execution time for PHP, and I don't want the end-user interface to just sit there bubbling away waiting for the Oracle processes to return a response anyway. I am considering creating a "master" PL/SQL stored procedure which would use the Oracle DBMS_SCHEDULER package to run a nearly-immediate job as a "background" (to the PHP interface) process. Is this the way to go, or are there other better solutions that I am overlooking?
How To Process The Passed Value In Php3?
one of my php3 page passes values to another php3 page. "www.mydomain.com/searchit.php3?variable=value" What are the commands to get/process the passed value? both the scripts or PHP3.
Want To Spawn Process From Windows PHP
I wanted to write some code purely on Linux, but unfortunately the document scanner drivers are non-existent for the high-end commercial document scanners. So, I had to port my Linux PHP project to Windows PHP (WAMP). There, I found a scanning tool (Kodak Image Scan - imgscan.ocx) that I can put on a VB form, tell it to scan some documents into a TIF file, and then shut down. I can run this VB app at command line just fine, but when I run it from either a popen(), system(), or exec() call, it won't detach from the PHP page. Instead, it just sits there. I can see the VB exe I made is being loaded properly in RAM, but unfortunately it sticks and won't unload on its own, nor will it tell the scanner to engage. I have to kill the VB exe and then the PHP page continues. What's the way to spawn a detached process from PHP on Windows?
Process Management In Windows
All I need to do is run a windows batch file from a small php program, and return the windows process id of the batch file. I have played around with proc_open() but that returns a resource id. Does anyone have a suggestion on what call I could use to get the windows process id returned within my program. I am using windows xp pro, and php 5/apache
Calling PHP From A Windows Process
I'm calling PHP from a windowsprocess in a simple Webserver application. I'm using the createprocess Windows API command.... C:PhpPHP Filename.php In this file I will open a TCP/IP connection to my SQL-server. When I do so, I always get the following error mysql_connect(): Can't create TCP/IP socket (10106) No I start a command shell and I call the same... C:PhpPHP Filename.php This will work without any error!! Same effect I get from all TCP/IP Actions (FTP etc....) Can somebody help me. Is it a PHP Setting, a server variable or a WindowsXP Access right problem?
Process Control Problem
I need to process some computation but i do not want the user wait the end of the computation but instead i would send the user a "wait refreshing page". When the computation is finished i would replace the refreshing page with the new page containing the results. So i need 2 processes one that would make the waiting page and one that would do computation and make the results page. I read in the php manual that handling processes within a web server environment could raise problems. Is there a simple and a clear manner to solve this problem?
Process Form With Both Javascript And PHP
PHP/Javascript. I have a simple form I want to validate the fields with javascript and then run the PHP script. All the scripts are in one page. I want PHP to control where the next page is. It works fine without the javascript but when I add the javascript the page doesn't do anything besides the validation. Thanks for your help... Chong ----login.html-------------------------------- <?php ob_start(); session_start(); require('datasource.html'); switch ($_POST['process']) { case 'Login': $_SESSION['login'] = $_POST['login']; $sql = "SELECT first_name, last_name, security_access, expire, passwd_date FROM sy_user WHERE login = '".$_SESSION['login']."' AND password = '".substr(sha1($_POST['password']), 0, 10)."'"; $result = mysql_query($sql); if (mysql_num_rows($result) < 1) { $msg = "Invalid login and password!"; } else { $row = mysql_fetch_assoc($result); $_SESSION['first_name'] = $row['first_name']; $_SESSION['last_name'] = $row['last_name']; $_SESSION['security_access'] = $row['security_access']; $passwd_date = $row['passwd_date']; $expire = $row['expire']; if ($passwd_date + $expire < date('Y-m-j')) { header('location: expired.html'); } else { header('location: main.html'); } } } ?> <SCRIPT LANGUAGE="JavaScript"> function checkrequired(form) { for(f=0;f<form.length;f++) { if(form[f].name.substring(4,length)=="reqd") { if(form[f].value){continue} else {
Starting A Process On The Server
after putting my self through hell trying to call an executable with Java. (which I was doing correctly according to the specs, but there is something f$#%ed up with the implementation of Runtime.exec() on this OS--Linux for those of you who are wondering, when I recomiled everything on NT it runs as expected, which is unfortunate) Anyway, I was just curious, since I haven't really taken PHP very far, and haven't played with it since PHP3, what would one do to call an executable on the server file system? with arguments?
Security With Checkout Process
for the checkout process of an online store...i'm wondering what to do about passing sensitive information between pages. i was thinking of having a 3 step checkout process... if i have a page where they enter their address and phone number and such...is it relatively safe to post that info to another page using a form? is there anything i should be watching for?
|