![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
fugix
-
Posts
1,483 -
Joined
-
Last visited
Posts posted by fugix
-
-
you cant transfer a query from one php page to another like that...write out your query again to get the correct picture id and use that to put in your header dynamic url
-
have you tried
$file = "testfile.mp3"; $path = http://www.mycompany6.com/php/; $file = {$path}{$filename}; $file_size = filesize($file); echo $file_size;
-
in delete.php...where is your $row_Recordset1['id'] coming from...you must set up your query again before using this for your redirect
<?php header("Location: image_show.php?id={$row_Recordset1['id']}"); require('connect.php'); $deleteid=$_GET['id']; mysql_query("DELETE FROM comment WHERE id='$deleteid'") or die(mysql_error()); ?>
-
at least you have someone there to guide you. My first day on the job has usually involved being hired because the previous 1-man-dev-crew left, so I got to walk in the door and figure out what was going on myself.
The person showing me around just went "blah blah blah"
lol...thats how it usually is
-
yeah php code too please
-
when do you get the bad photo id message? show me the script too please
-
-
also am a computer science graduate, 21 yrs old, basic knowledge of css, html, xml, xslt , web services, oracle and sql/mysql.
cool, we can use your knowledge to help out
-
lol its cool, change it to this...remember to use <?php instead of <?
<?php $con = mysql_connect('a','a','a') or die(mysql_error()); mysql_select_db('a') or die(mysql_error()); ?>
then tell me what you get when trying to delete
-
Alright, so I am writing a script for a secretary to do some data entry. With this script there is a few file upload fields, now depending on the item entered not all fields need to be filled out. Therefore, the SQL statement will change depending on whether or not that field was filled out.
Should I just use IF statements to check too see if the POST var was sent, then change the statement accordingly, or would there be a more productive way?
Thanks for any feedback..
that's what i normally do, if not all of the data is required I set up if statements to see which data is passed an i insert that data in to the db
-
alright whats the error you get when you add this
<?php require('connect.php'); $deleteid=$_GET['id']; mysql_query("DELETE FROM comment WHERE id='$deleteid'") or die(mysql_error()); header("Location: image_show.php?id={$row_Recordset1['id']}"); ?>
-
can you show me the errors
-
made a change to the above code...took out the echo
-
also, header is a php function so you wont need the php tags inside...try
header("Location: image_show.php?id=$row_Recordset1['id']");
-
what errors are you receiving?
-
Thanks for the help, I will try out your suggestion and let you know how I get on.
Thanks a million.
James
no problem, if you need anymore help with it just let us know!
-
yep, just use the same method that you used to get the id for the picture link and the form action and apply it to the redirect and you should be good!
-
welcome!
-
Figured it out - it was a simple logic error...
the 2nd regexp looks for data between the </h2> and next <h2> - but if the file only has 1 set of <h2></h2> tags there won't be another <h2> tag to capture data between!
Back to the drawing board
glad you figured that one out!!
-
glad you got it working...sorry it took me so long to figure it out, was starting to confuse even myself. If you need help with the delete function let me know
-
yeah as over whelming as it was, im really looking forward to day 2!
-
Okay!
I figured it out a bit - the following code will display the article title, and the article itself in order as it works it's way through the article as a whole (except the last article does not display the article text, just the title).
Next up I'll start tinkering with writing all of these things to their own files and saving them as the article title!
Thanks again for all of your help Fugix!
I'm going to keep this thread open just a bit more because I'm sure I may have questions on writing the new files.
<?php echo "<b>Article List:</b>"; $html = file_get_contents("Articles-lot-5-6.html"); $regexptitle = '#\<h2\>(.+?)\<\/h2\>#s'; $regexpdata = '#\<\/h2\>(.+?)\<h2\>#s'; $count = 0; if (preg_match_all($regexptitle, $html, $matches)) { If (preg_match_all($regexpdata, $html, &$matches2)){ while ($count < count($matches[0]) ){ $count++ ; echo $matches[0][$count]; echo $matches2[0][$count]; } } } else { "There were no article titles found"; } ?>
im glad you figured it out!! I'll be here if you need anything else!
-
lol yeah, prpbably all of us...glad you landed a job and hope everything goes well!
-
welcome to phpfreaks!
hello to phpfreaks
in Introductions
Posted
nerds...![;D](https://forums.phpfreaks.com/uploads/emoticons/default_wink-01.gif)
![:shrug:](https://forums.phpfreaks.com/uploads/emoticons/default_shrug.gif)