-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
Not sure what you want to do. Eminently do-able of course, but why do you want to do this thing: IF SiteGallery == 1 THEN 'checked' The button will be in a checked state if the value equals 1. Are you saying you want to set the radio button checked/unchecked when you output the page? Then use that same logic to set a var to null or 'checked' and add that var to your input tag. $on=''; $off=''; if ($SiteGallery == '1') $on = 'checked'; else $off = 'checked'; echo "<label>Gallery On <input type='radio' name='SiteGallery' value='1' $on/> </label> <label>Gallery Off <input type='radio' name='SiteGallery' value='0' $off /> </label>";
-
Look up the 'continue' statement. It's how you skip an iteration of a loop, which is what you want to do. As well as moving that section of html code INTO your while loop.
-
XLS or xsl?? Do you mean "spreadsheet", aka, a client file? Saving a file to your server (aka, 'uploading') is simple. You can find many examples of how to code this. Try google. As for setting a php var with the header statement you proposed, I don't think that works. But I've been wrong many times.
-
Of course you need a coder! You would dare to dive into some great working code yourself?
-
Get or post does not matter. U need to think some more
-
turning on error checking will allow you to debug your code so that at least the syntax is correct even if it doesn't do what you want. That is half the battle for newcomers. Been there. Done that. Still do.
-
you didn't answer litebearer's question. You "say" that you have been unsuccessful using session_start(). What does that mean? You already have a clear understanding of the difference between setting a cookie and setting a session variable and their lifetimes. What is it you seek?
-
The background may come in handy later on. For now - where are the dropdown boxes you referred to? And if you wish to build them , my prev post tells you what to change. And again - why all the divs? That is not how you build a web page.
-
Again - no execute in sight prior to getting the inserted id value. Also - you appear to be mixing the use of MySQL functions with pdo - no can do. What is the getValue function - I am unfamiliar with that one (amongst a lot of other things!) Again - your code is flawed - can't possibly be running. Hanging comma in your query statement. Do you have error checking enabled??? Put this at the top of every script until you are done developing them: error_reporting(E_ALL | E_STRICT); ini_set('display_errors', '1');} set_time_limit(2); // avoid runaway conditions change if necessary.
-
Would love to help you out. However, you could make our help easier to obtain if you asked a direct question and pointed us to the code you suspect is the problem. This whole script can't be your problem, so do your debugging and show us what you've found.
-
HTH. If you find success, be sure to come back here and mark your question as answered.
-
Not familiar with printing using JS. Have had much success using the FPDF class of php. Takes a little experimenting to get used to it but works great. Allows you complete freedom in design an output, so designing your journal output page will be easy, then you simply call your PrintPDF function with a php var containing the addressee and the journal text and you're done. Of course you will have to actually manually press File,Print at the end of your process, but that's minor.
-
Try putting quotes around your indices. You should also learn to use single quotes so you don't have to keep escaping double quotes in double-quoted strings. Less typing, less errors perhaps.
-
Most important - we don't see where you actually executed the query. Please don't show us re-typed code samples - time and time again they will have errors in them. Paste in the section of code you are questioning instead of trying to type it in for us. Waste of your time and ours. Tip - you can use single quotes around your php vars in the query string since it is wrapped in double quotes already. $sql="INSERT INTO ip_requests (make,model,qub_id,mac,dnsname,) VALUES ('$make', '$model', '$qub_id', 'mac', '$dnsname' ") Much less typing and easier to read and understand.
-
What drop down boxes? I didn't see any in your long sample of code. Simply loop thru your results and build the <option> statements using an element of your $row instead of building table rows. BTW - why so maaaannny <div>? Bad practice. Also - you'll be happier in the long run if you use associative arrays when retrieving your results. Using 'num' can lead to trouble down the road if you change your table structure. Unless you have an awful lot of fields in your table, using nums doesn't buy you a thing.
-
Do some googling on "js window open". You'll find a lot of info on how to use js in your main page to open a window of a specific size/location and call a php script to run and populate it.
-
And that's what I deduced. As for your error. Your original post: <?php if (strpos($_SERVER['REQUEST_URI'], 'upload.php') == false) { echo 'the stuff below is removed, or if the URL is something else, its not removed' ?> is flawed. You are missing the closing curly bracket as well as a semi at the end of the echo. So obviously you've never run this code. Anyway this statement says "if the uri does NOT contain 'upload.php' show the message 'stuff is removed'. You were close - you just have to include the code that you wanted to remove. So - taking my post and correcting it you would have: <?php if (strpos($_SERVER['REQUEST_URI'], 'upload.php') == false) { echo '<div class="navbar" name"navbar" Id="navbar">'; // this line has an error echo '<div class="navbar-inner" name="navbar-inner" Id="navbar-inner">'; echo a_view('core/account/login_dropdown'); // I'm assuming that "a_view" is some function defined somewhere echo a_view_menu('topbar', array('sort_by' => 'priority', array('menu-hz') ) ); // again - a function call? echo a_view('search/search_box', array('class' => 'search-header')); echo '</div> </div>'; } Now the code will NOT be displayed if the uri contains your script name.
-
I'm assuming that the Title and Description change with the image. You need to hide them in input tags along with the image name when you send the output to the client and then grab them in your php from the POST array upon Submit and pass the text vars to your email and attach the image file to the email. Not familiar with sending images in email myself, so I can't offer anything more.
-
You're mixing client side code with server side code. No Can Do. If you want your php to grab the contents of the div, you need to get it into your $_POST array somehow. (or $_GET.) Since a div is not an input field you need to change your html to make it so, which sounds silly. What exactly is in this div that you want to "send" to someone?
-
Have no idea what you are trying to do, but try this. <?php if (strpos($_SERVER['REQUEST_URI'], 'upload.php') == false) { echo 'the stuff below is removed, or if the URL is something else, its not removed' } else { echo '<div class="navbar" name"navbar" Id="navbar">'; echo '<div class="navbar-inner" name="navbar-inner" Id="navbar-inner">'; echo a_view('core/account/login_dropdown'); echo a_view_menu('topbar', array('sort_by' => 'priority', array('menu-hz') ) ); echo a_view('search/search_box', array('class' => 'search-header')); echo '</div> </div>'; } This would prevent the second part from being output. Note - there is at least one error in that code, so I don't think it's working as shown. Also your first if statement is backwards if you want the "else" stuff dropped if the uri is upload.php
-
That is definitely the lack of using "dot equals" as you build your output string.
-
while ($completed_customers = MySQL_fetch_array($completed_orders) { (build your heml) } echo </table> echo your accumulated html BTW - in your loop you are re-initializing $requested_customers every time, so you are probably only seeing the very last customer anyway. s/b "$requested_customers .= blah blah blah;
-
i have an undefined index error, please aid me
ginerjm replied to chosensiren's topic in PHP Coding Help
So - show us the code that comprises the web page itself. I'm guessing you have no <input> tags with "name='firstname' " or "name='lastname' ", etc. That or the fields are not within the <form>... </form> tags. Or you are using a "method='GET' " in your form. -
Hard to help when you don't ask a specific question. Assuming that you are talking about coordination of the id on all 3 tables - your use of the MySQL_insert_id function gets you a key value; use it to set values in the other two tables which are NOT auto-increment fields. BTW - you do know that MySQL-*** functions are deprecated in php and should be avoided for all new development.
-
For future reading here is the link you asked for: http://dev.mysql.com/doc/refman/5.5/en/insert-select.html